Skip to content

ob_end_clean does not reset Content-Encoding header #8218

Closed
@manuelm

Description

@manuelm

Description

Follow up from: #7953

The following code:

<?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 header is set to gzip but the output is plain text.

This breaks the export + download functionality of phpMyAdmin. We fixed the export function by adding an additional header_remove("Content-Encoding") after cleaning and ending the output buffering. Is this new behavior intended and PMA should fix it or a bug in PHP?

PHP Version

8.0.17 + 8.1.4

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions