X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=img_auth.php;h=ba4ed748348235de108f382d4cee24dc906d2d10;hb=40ce67065f56227e54dd46120d71b56df08ef922;hp=ca69d31d53e80b18d600b2125cf830f9a3282723;hpb=7cd7c534f7c86fff63bbd372dc081816df7d65ca;p=lhc%2Fweb%2Fwiklou.git diff --git a/img_auth.php b/img_auth.php index ca69d31d53..ba4ed74834 100644 --- a/img_auth.php +++ b/img_auth.php @@ -148,7 +148,7 @@ function wfImageAuthMain() { } // Run hook for extension authorization plugins - /** @var $result array */ + /** @var array $result */ $result = null; if ( !Hooks::run( 'ImgAuthBeforeStream', [ &$title, &$path, &$name, &$result ] ) ) { wfForbidden( $result[0], $result[1], array_slice( $result, 2 ) ); @@ -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 ); } /** @@ -186,13 +186,12 @@ function wfImageAuthMain() { * subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2 * @param string $msg1 * @param string $msg2 + * @param mixed ...$args To pass as params to wfMessage() with $msg2. Either variadic, or a single + * array argument. */ -function wfForbidden( $msg1, $msg2 ) { +function wfForbidden( $msg1, $msg2, ...$args ) { global $wgImgAuthDetails; - $args = func_get_args(); - array_shift( $args ); - array_shift( $args ); $args = ( isset( $args[0] ) && is_array( $args[0] ) ) ? $args[0] : $args; $msgHdr = wfMessage( $msg1 )->escaped();