From be10c2988f4ba7f4cd591506440d897cd0a02630 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 19 Jun 2008 12:29:48 +0000 Subject: [PATCH] bug #1996943 [export] Firefox 3 and .sql.gz (corrupted) --- ChangeLog | 1 + export.php | 6 +++++- libraries/Config.class.php | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f8d95547..8a4290608 100644 --- a/ChangeLog +++ b/ChangeLog @@ -89,6 +89,7 @@ danbarry - bug #1981043 [export] HTML in exports getting corrupted, thanks to Jason Judge - jasonjudge - bug #1936761 [interface] BINARY not treated as BLOB: update/delete issues +- bug #1996943 [export] Firefox 3 and .sql.gz (corrupted) 2.11.6.0 (2008-04-29) - bug #1903724 [interface] Displaying of very large queries in error message diff --git a/export.php b/export.php index 841926d04..ce3c07bb1 100644 --- a/export.php +++ b/export.php @@ -286,7 +286,11 @@ if ($asfile) { // It seems necessary to check about zlib.output_compression // to avoid compressing twice if (!@ini_get('zlib.output_compression')) { - $content_encoding = 'x-gzip'; + // On Firefox 3, sending this content encoding corrupts the .gz + // (as tested on Windows and Linux) + if (! (PMA_USR_BROWSER_AGENT == 'FIREFOX' && PMA_USR_BROWSER_VER >= '3.0')) { + $content_encoding = 'x-gzip'; + } $mime_type = 'application/x-gzip'; } } elseif ($compression == 'zip') { diff --git a/libraries/Config.class.php b/libraries/Config.class.php index 06b733d1b..c9fc30cdf 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -178,6 +178,9 @@ class PMA_Config && preg_match('@Safari/([0-9]*)@', $HTTP_USER_AGENT, $log_version2)) { $this->set('PMA_USR_BROWSER_VER', $log_version[1] . '.' . $log_version2[1]); $this->set('PMA_USR_BROWSER_AGENT', 'SAFARI'); + } elseif (preg_match('@Firefox(/| )([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) { + $this->set('PMA_USR_BROWSER_VER', $log_version[2]); + $this->set('PMA_USR_BROWSER_AGENT', 'FIREFOX'); } elseif (preg_match('@Mozilla/([0-9].[0-9]{1,2})@', $HTTP_USER_AGENT, $log_version)) { $this->set('PMA_USR_BROWSER_VER', $log_version[1]); $this->set('PMA_USR_BROWSER_AGENT', 'MOZILLA');