Index: admin_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.module,v
retrieving revision 1.43.2.17.2.5
diff -u -r1.43.2.17.2.5 admin_menu.module
--- admin_menu.module	4 Apr 2009 15:23:18 -0000	1.43.2.17.2.5
+++ admin_menu.module	9 Apr 2009 13:23:19 -0000
@@ -269,19 +269,12 @@
 
   // @todo According to http://www.mnot.net/blog/2006/05/11/browser_caching,
   //   IE will only cache the content when it is compressed.
-  // Determine if the client accepts gzipped data.
-  if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && function_exists('gzencode')) {
-    if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) {
-      $encoding = 'gzip';
-    }
-    elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== FALSE) {
-      $encoding = 'x-gzip';
-    }
-    if (!empty($encoding)) {
-      header('Vary: Accept-Encoding');
-      header('Content-Encoding: ' . $encoding);
-      $content = gzencode($content, 9, FORCE_GZIP);
-    }
+  // Determine if the client accepts gzipped data. Also, check if PHP has the
+  // zlib extension installed and automatic output compression is not enabled.
+  if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE && function_exists('gzencode') && zlib_get_coding_type() === FALSE) {
+    header('Vary: Accept-Encoding');
+    header('Content-Encoding: gzip');
+    $content = gzencode($content, 9, FORCE_GZIP);
   }
 
   $expires = time() + (3600 * 24 * 365);
