plugins/SpecialUpdownload.php
changeset 80 cb7dde69c301
parent 23 320acf077276
child 81 d7fc25acd3f3
--- a/plugins/SpecialUpdownload.php	Mon Jul 30 10:46:17 2007 -0400
+++ b/plugins/SpecialUpdownload.php	Wed Aug 01 13:39:27 2007 -0400
@@ -269,29 +269,7 @@
   header('Last-Modified: '.date('r', $row['time_id']));
   echo($data);
   
-  //
-  // Compress buffered output if required and send to browser
-  //
-  if ( $do_gzip )
-  {
-    //
-    // Copied from phpBB, which was in turn borrowed from php.net
-    //
-    $gzip_contents = ob_get_contents();
-    ob_end_clean();
-  
-    $gzip_size = strlen($gzip_contents);
-    $gzip_crc = crc32($gzip_contents);
-  
-    $gzip_contents = gzcompress($gzip_contents, 9);
-    $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
-  
-    header('Content-encoding: gzip');
-    echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
-    echo $gzip_contents;
-    echo pack('V', $gzip_crc);
-    echo pack('V', $gzip_size);
-  }
+  gzip_output();
   
   exit;