From 9189db0c50cd4f755efc1d0ce061f6c04b236a40 Mon Sep 17 00:00:00 2001 From: Reedy Date: Sat, 20 Apr 2019 02:06:50 +0100 Subject: [PATCH 1/1] Stop calling FileRepo->streamFile() Change-Id: Ifdf379dc7f2501e561dfbc06f9afa7a9089306f2 --- img_auth.php | 2 +- includes/specials/SpecialRevisionDelete.php | 2 +- includes/specials/SpecialUndelete.php | 2 +- includes/specials/SpecialUploadStash.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) 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(); } /** -- 2.20.1