Cancel output buffering in StreamFile; when used inside gzip buffering this could...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 13 Jun 2006 20:22:08 +0000 (20:22 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 13 Jun 2006 20:22:08 +0000 (20:22 +0000)
RELEASE-NOTES
includes/StreamFile.php

index 0d2f9f2..0b003da 100644 (file)
@@ -487,6 +487,8 @@ Some default configuration options have changed:
 * (bug 5932) Introduce {{PAGESINNAMESPACE}} magic word
 * Disable $wgAllowExternalImages by default.
 * (bug 2700) Nice things like link completion and signatures now work in <gallery> tags.
+* Cancel output buffering in StreamFile; when used inside gzip buffering this
+  could cause funny timeout behavior as the Content-Length was wrong.
 
 
 == Compatibility ==
index ce7650a..4b659de 100644 (file)
@@ -16,6 +16,14 @@ does not.</p>
 
        header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', $stat['mtime'] ) . ' GMT' );
 
+       // Cancel output buffering and gzipping if set
+       while( $status = ob_get_status() ) {
+               ob_end_clean();
+               if( $status['name'] == 'ob_gzhandler' ) {
+                       header( 'Content-Encoding: identity' );
+               }
+       }
+       
        if ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
                $modsince = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
                $sinceTime = strtotime( $modsince );