From:             public at asd-group dot com
Operating system: Windows XP
PHP version:      4.3.1
PHP Bug Type:     HTTP related
Bug description:  Strange HTTP headers behaviour when using output buffering and 
callback

I'm using output buffering with a callback specified in ob_start. I'm also
using the second parameter of value 2 (callback gets called each time
output occurs in the application, rather than just once when the whole
output buffer is flushed).

My callback always returns an empty string, telling PHP to ignore the
output, however as soon as this happens (ie. first 'echo' or 'print'
statement in application) headers_sent starts to return true.

However the HTTP headers (and terminating blank line) cant have been sent
because my own calls to header() later on (eg. to set cookies) still work.


Also, due to this, any code which expects output buffering to be on, and
which checks headers_sent() before sending its own headers (after doing
HTML output) will break using output buffering this way. 
 

-- 
Edit bug report at http://bugs.php.net/?id=22713&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22713&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22713&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22713&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22713&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22713&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22713&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22713&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22713&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22713&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22713&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22713&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22713&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22713&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22713&r=gnused

Reply via email to