Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions libraries/classes/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use function hash_equals;
use function hash_hmac;
use function header;
use function header_remove;
use function htmlspecialchars;
use function http_build_query;
use function implode;
Expand Down Expand Up @@ -637,15 +638,20 @@ public static function downloadHeader(
/** @var string $browserVersion */
$browserVersion = $GLOBALS['PMA_Config']->get('PMA_USR_BROWSER_VER');

/**
* @see https://github.com/phpmyadmin/phpmyadmin/issues/11283
*/
$notChromeOrLessThan43 = $browserAgent != 'CHROME' || $browserVersion < 43;

// inform the server that compression has been done,
// to avoid a double compression (for example with Apache + mod_deflate)
if (strpos($mimetype, 'gzip') !== false && $notChromeOrLessThan43) {
header('Content-Encoding: gzip');
if (strpos($mimetype, 'gzip') !== false) {
/**
* @see https://github.com/phpmyadmin/phpmyadmin/issues/11283
*/
if ($browserAgent != 'CHROME' || $browserVersion < 43) {
header('Content-Encoding: gzip');
}
} else {
// The default output in PMA uses gzip,
// so if we want to output uncompressed file, we should reset the encoding.
// See PHP bug https://github.com/php/php-src/issues/8218
header_remove('Content-Encoding');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the php bug link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait to see what will result from the PHP bug report. I don't know which bug to refer to here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Do you know when this gonna be release ?

We have many customers impacted by this bugs and could be helped thanks this patch

Best regards

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonjour Henri,

I can not give a date for the release but this fix will be shipped in the next 5.1 release.
When it is merged you can try it with snapshots: (phpMyAdmin 5.1+snapshot)
Will that be okay for you in the mean time ?

}
header('Content-Transfer-Encoding: binary');
if ($length <= 0) {
Expand Down