includes/functions.php
changeset 1112 679916c80599
parent 1110 1a3f374310ca
child 1115 b3c249d06990
--- a/includes/functions.php	Sun Aug 30 00:05:33 2009 -0400
+++ b/includes/functions.php	Fri Sep 11 09:57:42 2009 -0400
@@ -3157,11 +3157,18 @@
 {
   global $do_gzip;
   
+  $gzip_supported = false;
+  if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
+  {
+    $encodings = explode(',', $_SERVER['HTTP_ACCEPT_ENCODING']);
+    $gzip_supported = in_array('gzip', $encodings) || in_array('deflate', $encodings);
+  }
+  
   //
   // Compress buffered output if required and send to browser
   // Sorry, doesn't work in IE. What else is new?
   //
-  if ( $do_gzip && function_exists('gzdeflate') && !strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && !headers_sent() )
+  if ( $do_gzip && function_exists('gzdeflate') && !strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && !headers_sent() && $gzip_supported )
   {
     $gzip_contents = ob_get_contents();
     ob_end_clean();