X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FException.php;h=dc1208a0d10fe0ecee55a3f011c727d17b0c1d7f;hb=9688fe9e8ed621ce90a47b1344902f3d794ca590;hp=b42ae994ffecd8bb06f371a121669005162107d4;hpb=aba48f4ef94fb85b571a25cb9fb49a9a62dc3f44;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Exception.php b/includes/Exception.php index b42ae994ff..dc1208a0d1 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -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 ); } } @@ -698,7 +668,7 @@ class MWExceptionHandler { if ( defined( 'STDERR' ) ) { fwrite( STDERR, $message ); } else { - echo( $message ); + echo $message; } }