X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Ffilerepo%2FFileRepo.php;h=5d22b8d80db0b8052d6d1b2ad3edffe5cf2d3ec5;hb=f036c5b324e2b2d240edf8d5eeb7fc2af3d88c47;hp=f89d96b218e10012b6bd6bef68e56efebddb7ef5;hpb=1c7f71cefab6a2b3163312bccaa3c46bc61b063d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index f89d96b218..5d22b8d80d 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1543,7 +1543,7 @@ class FileRepo { */ public function getFileProps( $virtualUrl ) { $fsFile = $this->getLocalReference( $virtualUrl ); - $mwProps = new MWFileProps( MimeMagic::singleton() ); + $mwProps = new MWFileProps( MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() ); if ( $fsFile ) { $props = $mwProps->getPropsFromPath( $fsFile->getPath(), true ); } else { @@ -1602,9 +1602,15 @@ class FileRepo { $path = $this->resolveToStoragePath( $virtualUrl ); $params = [ 'src' => $path, 'headers' => $headers, 'options' => $optHeaders ]; + // T172851: HHVM does not flush the output properly, causing OOM + ob_start( null, 1048576 ); + ob_implicit_flush( true ); + $status = $this->newGood(); $status->merge( $this->backend->streamFile( $params ) ); + ob_end_flush(); + return $status; }