X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fexception%2FMWException.php;h=cb7ff19b35812ca45526c3682c6717facc283778;hb=4d6828ef7835b7c5c5e903637fcba4bf5c487e1b;hp=502cee82b7e938bb16bde4e8f87c1debe5228a02;hpb=43a0144346da4e6edbbadee0b7d9def53357bc10;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 502cee82b7..cb7ff19b35 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -69,23 +69,22 @@ class MWException extends Exception { * @param string $key Message name * @param string $fallback Default message if the message cache can't be * called by the exception - * The function also has other parameters that are arguments for the message + * @param mixed ...$params To pass to wfMessage() * @return string Message with arguments replaced */ - public function msg( $key, $fallback /*[, params...] */ ) { + public function msg( $key, $fallback, ...$params ) { global $wgSitename; - $args = array_slice( func_get_args(), 2 ); // FIXME: Keep logic in sync with MWExceptionRenderer::msg. $res = false; if ( $this->useMessageCache() ) { try { - $res = wfMessage( $key, $args )->text(); + $res = wfMessage( $key, $params )->text(); } catch ( Exception $e ) { } } if ( $res === false ) { - $res = wfMsgReplaceArgs( $fallback, $args ); + $res = wfMsgReplaceArgs( $fallback, $params ); // If an exception happens inside message rendering, // {{SITENAME}} sometimes won't be replaced. $res = strtr( $res, [