Stop calling FileRepo->streamFile()
authorReedy <reedy@wikimedia.org>
Sat, 20 Apr 2019 01:06:50 +0000 (02:06 +0100)
committerReedy <reedy@wikimedia.org>
Sat, 20 Apr 2019 01:06:50 +0000 (02:06 +0100)
Change-Id: Ifdf379dc7f2501e561dfbc06f9afa7a9089306f2

img_auth.php
includes/specials/SpecialRevisionDelete.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUploadStash.php

index 0a209e9..ba4ed74 100644 (file)
@@ -177,7 +177,7 @@ function wfImageAuthMain() {
 
        // Stream the requested file
        wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." );
-       $repo->streamFile( $filename, $headers, $options );
+       $repo->streamFileWithStatus( $filename, $headers, $options );
 }
 
 /**
index f0bac45..dd6fea7 100644 (file)
@@ -353,7 +353,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
 
                $key = $oimage->getStorageKey();
                $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
-               $repo->streamFile( $path );
+               $repo->streamFileWithStatus( $path );
        }
 
        /**
index 5f69426..456face 100644 (file)
@@ -687,7 +687,7 @@ class SpecialUndelete extends SpecialPage {
 
                $repo = RepoGroup::singleton()->getLocalRepo();
                $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
-               $repo->streamFile( $path );
+               $repo->streamFileWithStatus( $path );
        }
 
        protected function showHistory() {
index 24d58c8..c278bab 100644 (file)
@@ -322,10 +322,10 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                        );
                }
 
-               return $file->getRepo()->streamFile( $file->getPath(),
+               return $file->getRepo()->streamFileWithStatus( $file->getPath(),
                        [ 'Content-Transfer-Encoding: binary',
                                'Expires: Sun, 17-Jan-2038 19:14:07 GMT' ]
-               );
+               )->isOK();
        }
 
        /**