X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fexception%2FMWExceptionRenderer.php;h=1f1cabeae154d2f0e03729057d17dbc48db99dbc;hb=1de7117197761961736ea43b237599569eee93a2;hp=49cf71e624e701d0623347d6bab5eed1f6841ef0;hpb=f506a05aaa035b96537b33244b0f18b093048e97;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index 49cf71e624..1f1cabeae1 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -197,12 +197,17 @@ class MWExceptionRenderer { * @return string Message with arguments replaced */ private static function msg( $key, $fallback /*[, params...] */ ) { + global $wgSitename; $args = array_slice( func_get_args(), 2 ); try { - return wfMessage( $key, $args )->text(); + $res = wfMessage( $key, $args )->text(); } catch ( Exception $e ) { - return wfMsgReplaceArgs( $fallback, $args ); + $res = wfMsgReplaceArgs( $fallback, $args ); + // If an exception happens inside message rendering, + // {{SITENAME}} sometimes won't be replaced. + $res = preg_replace( '/\{\{SITENAME\}\}/', $wgSitename, $res ); } + return $res; } /**