X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=img_auth.php;h=0a209e98b42464064adaf44049958004a5288752;hp=205280908b7095aa5b46c02a2750b5e8fd70bf59;hb=f9191ded82ea1a9c187c5a9cc332194919ed1464;hpb=08c266e1fdebcc13beb419ea655ca9bc487bc712 diff --git a/img_auth.php b/img_auth.php index 205280908b..0a209e98b4 100644 --- a/img_auth.php +++ b/img_auth.php @@ -17,7 +17,8 @@ * just that it was. If you want to change this, you can set $wgImgAuthDetails to 'true' * in localsettings.php and it will give the user the reason why access was denied. * - * Your server needs to support PATH_INFO; CGI-based configurations usually don't. + * Your server needs to support REQUEST_URI or PATH_INFO; CGI-based + * configurations sometimes don't. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,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 ) ); @@ -185,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();