X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FException.php;h=dc1208a0d10fe0ecee55a3f011c727d17b0c1d7f;hb=5b04704d304968ca49b6190ed0dd1d5ad819db45;hp=661d03dce8b2b4f7515a0d5b4d5630a4f3fcedf1;hpb=a0967bfcff30ed58b65435ad21a41f3548cee603;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Exception.php b/includes/Exception.php index 661d03dce8..dc1208a0d1 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -333,7 +333,7 @@ class ErrorPageError extends MWException { // customized by the local wiki. So get the default English version for // passing to the parent constructor. Our overridden report() below // makes sure that the page shown to the user is not forced to English. - if( $msg instanceof Message ) { + if ( $msg instanceof Message ) { $enMsg = clone( $msg ); } else { $enMsg = wfMessage( $msg, $params ); @@ -467,39 +467,9 @@ class ThrottledError extends ErrorPageError { */ class UserBlockedError extends ErrorPageError { public function __construct( Block $block ) { - global $wgLang, $wgRequest; - - $blocker = $block->getBlocker(); - if ( $blocker instanceof User ) { // local user - $blockerUserpage = $block->getBlocker()->getUserPage(); - $link = "[[{$blockerUserpage->getPrefixedText()}|{$blockerUserpage->getText()}]]"; - } else { // foreign user - $link = $blocker; - } - - $reason = $block->mReason; - if( $reason == '' ) { - $reason = wfMessage( 'blockednoreason' )->text(); - } - - /* $ip returns who *is* being blocked, $intended contains who was meant to be blocked. - * This could be a username, an IP range, or a single IP. */ - $intended = $block->getTarget(); - - parent::__construct( - 'blockedtitle', - $block->mAuto ? 'autoblockedtext' : 'blockedtext', - array( - $link, - $reason, - $wgRequest->getIP(), - $block->getByName(), - $block->getId(), - $wgLang->formatExpiry( $block->mExpiry ), - $intended, - $wgLang->timeanddate( wfTimestamp( TS_MW, $block->mTimestamp ), true ) - ) - ); + // @todo FIXME: Implement a more proper way to get context here. + $params = $block->getPermissionsError( RequestContext::getMain() ); + parent::__construct( 'blockedtitle', array_shift( $params ), $params ); } } @@ -617,7 +587,7 @@ class HttpError extends MWException { $content = htmlspecialchars( $this->content ); } - return "\n". + return "\n" . "$header\n" . "

$header

$content

\n"; } @@ -698,7 +668,7 @@ class MWExceptionHandler { if ( defined( 'STDERR' ) ) { fwrite( STDERR, $message ); } else { - echo( $message ); + echo $message; } }