X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Ffilerepo%2FFileRepo.php;h=5d22b8d80db0b8052d6d1b2ad3edffe5cf2d3ec5;hp=8edf81f13139edd3f053bcfd09dabe880fac784d;hb=c16af68fb62948dd8079a7fa49b7c12b9a748121;hpb=cbac334f116c6546c422a67ce99d2a56eb792d30 diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 8edf81f131..5d22b8d80d 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -776,7 +776,7 @@ class FileRepo { public function getDescriptionRenderUrl( $name, $lang = null ) { $query = 'action=render'; if ( !is_null( $lang ) ) { - $query .= '&uselang=' . $lang; + $query .= '&uselang=' . urlencode( $lang ); } if ( isset( $this->scriptDirUrl ) ) { return $this->makeUrl( @@ -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; }