[php-src] Issue #7953: Calling ob_clean() after ob_start('gz_handler') unsets Content-Encoding

From: Date: Mon, 17 Jan 2022 07:48:05 +0000
Subject: [php-src] Issue #7953: Calling ob_clean() after ob_start('gz_handler') unsets Content-Encoding
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239047@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7953 Comment Author: damianwadley Hmm, looks like I remembered ob_gzhandler backwards: it is a special string after all. It's an alias that goes through slightly different handling in that it will initialize a context, which ob_gzhandler the function does too but in a slightly different way. Thus why ob_start("ob_gzhandler") and ob_start(fn($buffer, $phase) => ob_gzhandler($buffer, $phase)); aren't the same. Looking into it more, it's not that the headers are removed but that they aren't added at all. I'm also seeing odd behavior with a flush + clean in that the special "ob_gzhandler" issues a "Failed to delete buffer" notice while the wrapped ob_gzhandler() call does not. So it seems like there's some iffy behavior with how it handles the CLEAN phases in general.

« previous php.bugs (#239047) next »