[php-src] Issue #8218: ob_end_clean does not reset Content-Encoding header
| From: | manuelm | Date: | Fri, 18 Mar 2022 13:56:40 +0000 |
| Subject: | [php-src] Issue #8218: ob_end_clean does not reset Content-Encoding header | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240411@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8218
Author: manuelm
### Description
Follow up from: https://github.com/php/php-src/issues/7953
The following code:
```php
<?php
ob_start('ob_gzhandler');
ob_end_clean();
echo 'Hello World';
```
Resulted in this output:
```
HTTP/1.1 200 OK
Date: ...
Server: Apache
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: Upgrade
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Hello World
```
Please note that the
Content-Encoding is set to gzip but the output is
plain text.
This breaks the export + download functionality of phpMyAdmin. We fixed this by adding an additional
header_remove("Content-Encoding") after cleaning and ending the output
buffering.
### PHP Version
8.0.17 + 8.1.4
### Operating System
_No response_