From: Reedy Date: Sat, 20 Apr 2019 01:06:50 +0000 (+0100) Subject: Stop calling FileRepo->streamFile() X-Git-Tag: 1.34.0-rc.0~1915 X-Git-Url: https://git.cyclocoop.org//%22%7B%7Blocalurle:Project:Pol%C3%ADtica_de_imagens%7D%7D/%22?a=commitdiff_plain;h=9189db0c50cd4f755efc1d0ce061f6c04b236a40;p=lhc%2Fweb%2Fwiklou.git Stop calling FileRepo->streamFile() Change-Id: Ifdf379dc7f2501e561dfbc06f9afa7a9089306f2 --- diff --git a/img_auth.php b/img_auth.php index 0a209e98b4..ba4ed74834 100644 --- a/img_auth.php +++ b/img_auth.php @@ -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 ); } /** diff --git a/includes/specials/SpecialRevisionDelete.php b/includes/specials/SpecialRevisionDelete.php index f0bac45ba3..dd6fea7333 100644 --- a/includes/specials/SpecialRevisionDelete.php +++ b/includes/specials/SpecialRevisionDelete.php @@ -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 ); } /** diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 5f694267ff..456facef12 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -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() { diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 24d58c834b..c278babd64 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -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(); } /**