X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fexception%2FMWException.php;h=502cee82b7e938bb16bde4e8f87c1debe5228a02;hb=d5dd48b8a67db6da521c88b9f1a00d640f76b337;hp=652a87dcfcd303473c732efc23c09066c743cf9d;hpb=74d04edec385aa86ee01943b9a27475d79f74e78;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 652a87dcfc..502cee82b7 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -76,6 +76,7 @@ class MWException extends Exception { global $wgSitename; $args = array_slice( func_get_args(), 2 ); + // FIXME: Keep logic in sync with MWExceptionRenderer::msg. $res = false; if ( $this->useMessageCache() ) { try { @@ -87,7 +88,9 @@ class MWException extends Exception { $res = wfMsgReplaceArgs( $fallback, $args ); // If an exception happens inside message rendering, // {{SITENAME}} sometimes won't be replaced. - $res = preg_replace( '/\{\{SITENAME\}\}/', $wgSitename, $res ); + $res = strtr( $res, [ + '{{SITENAME}}' => $wgSitename, + ] ); } return $res; } @@ -118,7 +121,7 @@ class MWException extends Exception { "Fatal exception of type $1", $type, $logId, - MWExceptionHandler::getURL( $this ) + MWExceptionHandler::getURL() ) ) ) . "