OSDN Git Service

BugTrack/738: Care for 'zlib.output_compression' at php.ini
authorhenoheno <henoheno>
Sat, 27 Nov 2004 10:59:42 +0000 (19:59 +0900)
committerhenoheno <henoheno>
Sat, 27 Nov 2004 10:59:42 +0000 (19:59 +0900)
plugin/attach.inc.php
plugin/ref.inc.php

index 8f560b6..2b8aba9 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-//  $Id: attach.inc.php,v 1.63 2004/11/11 13:27:39 henoheno Exp $
+//  $Id: attach.inc.php,v 1.64 2004/11/27 10:59:42 henoheno Exp $
 //
 
 /*
@@ -613,6 +613,12 @@ EOD;
                header('Content-Disposition: inline; filename="' . $filename . '"');
                header('Content-Length: ' . $this->size);
                header('Content-Type: '   . $this->type);
+
+               if(ini_get('zlib.output_compression')) {
+                       header('Content-Encoding: gzip');
+                       header('Vary: Accept-Encoding');
+               }
+
                @readfile($this->filename);
                exit;
        }
index 734ed0c..b012641 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: ref.inc.php,v 1.43 2004/11/11 13:27:39 henoheno Exp $
+// $Id: ref.inc.php,v 1.44 2004/11/27 10:59:42 henoheno Exp $
 //
 // Include an attached image-file as an inline-image
 
@@ -417,6 +417,12 @@ function plugin_ref_action()
        header('Content-Disposition: inline; filename="' . $filename . '"');
        header('Content-Length: ' . $size);
        header('Content-Type: '   . $type);
+
+       if(ini_get('zlib.output_compression')) {
+               header('Content-Encoding: gzip');
+               header('Vary: Accept-Encoding');
+       }
+
        @readfile($ref);
 
        exit;