Fix some injection from r110871
authorAntoine Musso <hashar@users.mediawiki.org>
Sun, 12 Feb 2012 19:51:03 +0000 (19:51 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sun, 12 Feb 2012 19:51:03 +0000 (19:51 +0000)
includes/cache/FileCacheBase.php

index 70bb221..d0cbe5f 100644 (file)
@@ -116,9 +116,12 @@ abstract class FileCacheBase {
         * @return string
         */
        public function fetchText() {
-               // gzopen can transparently read from gziped or plain text
-               $fh = gzopen( $this->cachePath(), 'rb' );
-               return stream_get_contents( $fh );
+               if( $this->useGzip() ) {
+                       $fh = gzopen( $this->cachePath(), 'rb' );
+                       return stream_get_contents( $fh );
+               } else {
+                       return file_get_contents( $this-cachePath() );
+               }
        }
 
        /**