#19440 [Opn]: ob_clean and ob_end_clean are broken

From: Date: Mon, 16 Sep 2002 18:21:06 +0000
Subject: #19440 [Opn]: ob_clean and ob_end_clean are broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19484@lists.php.net to get a copy of this message
ID: 19440 User updated by: madeinlisboa@yahoo.com Reported By: madeinlisboa@yahoo.com Status: Open Bug Type: Output Control Operating System: W2K PHP Version: 4.2.3 New Comment: I found what is causing it. Setting "ob_gzhandler" as the default output handler in the php.ini or in a script, causes this behaviour. if "ob_gzhandler" is not used, buffering is fine. Previous Comments: ------------------------------------------------------------------------ [2002-09-16 13:04:39] madeinlisboa@yahoo.com In the example I removed some elements from the array and forgot to delete last comma. sorry ------------------------------------------------------------------------ [2002-09-16 13:02:05] madeinlisboa@yahoo.com When any of these 2 functions are called, I get no output or the output is garbled. eg (I run this at the end of printable pages, to remove form fields, etc... Get buffer, change it, then print it): $search = Array( "|<script[^>]*?>.*?</script>|si", "|<a href=\"#topo\">.*?</a>|si", "|<form[^>]*?>.*?</form>|si", "|<a[^>]*?>|si", "|</a\s*>|si", ); $contents = ob_get_contents(); // gets output buffer, empties it and print without forms ob_clean(); echo preg_replace($search, '', $contents); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19440&edit=1

« previous php.bugs (#19484) next »