Fix 2714 : backlink from special:whatlinkshere was hard set as 'existing'
[lhc/web/wiklou.git] / includes / StreamFile.php
index e154d6a..eb7266e 100644 (file)
@@ -1,8 +1,9 @@
 <?php
+/** */
 
+/** */
 function wfStreamFile( $fname ) {
-       global $wgSquidMaxage;
-       $stat = stat( $fname );
+       $stat = @stat( $fname );
        if ( !$stat ) {
                header( 'HTTP/1.0 404 Not Found' );
                echo "<html><body>
@@ -13,7 +14,6 @@ does not.</p>
                return;
        }
 
-       header( "Cache-Control: s-maxage=$wgSquidMaxage, must-revalidate, max-age=0" );
        header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', $stat['mtime'] ) . ' GMT' );
 
        if ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
@@ -37,6 +37,7 @@ does not.</p>
        readfile( $fname );
 }
 
+/** */
 function wfGetType( $filename ) {
        global $wgTrivialMimeDetection;
 
@@ -46,13 +47,13 @@ function wfGetType( $filename ) {
                $ext= strtolower(strrchr($filename, '.'));
                
                switch ($ext) {
-                       case '.gif': return "image/gif";
-                       case '.png': return "image/png";
-                       case '.jpg': return "image/jpeg";
-                       case '.jpeg': return "image/jpeg";
+                       case '.gif': return 'image/gif';
+                       case '.png': return 'image/png';
+                       case '.jpg': return 'image/jpeg';
+                       case '.jpeg': return 'image/jpeg';
                }
                
-               return "unknown/unknown";
+               return 'unknown/unknown';
        }
        else {
                $magic=& wfGetMimeMagic();