X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FTitle.php;h=739c52a38f55ebfc1c44a738684708f7b7f3a660;hb=2849d8a6b3542795d230515a600670533adb2692;hp=fda790fdd961c675fca1a698d7a8d06a58ffb28c;hpb=3dc6844ae15512838c9ec70b4903090c2723967f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index fda790fdd9..739c52a38f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -757,7 +757,7 @@ class Title { */ public function getTalkNsText() { global $wgContLang; - return( $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) ) ); + return $wgContLang->getNsText( MWNamespace::getTalk( $this->mNamespace ) ); } /** @@ -766,7 +766,7 @@ class Title { * @return Bool TRUE or FALSE */ public function canTalk() { - return( MWNamespace::canTalk( $this->mNamespace ) ); + return MWNamespace::canTalk( $this->mNamespace ); } /** @@ -1275,10 +1275,10 @@ class Title { */ public function getSubpageText() { if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) { - return( $this->mTextform ); + return $this->mTextform; } $parts = explode( '/', $this->mTextform ); - return( $parts[count( $parts ) - 1] ); + return $parts[count( $parts ) - 1]; } /** @@ -1318,7 +1318,7 @@ class Title { public function getSubpageUrlForm() { $text = $this->getSubpageText(); $text = wfUrlencode( str_replace( ' ', '_', $text ) ); - return( $text ); + return $text; } /** @@ -2046,7 +2046,7 @@ class Title { return $errors; } - global $wgContLang, $wgLang, $wgEmailConfirmToEdit; + global $wgEmailConfirmToEdit; if ( $wgEmailConfirmToEdit && !$user->isEmailConfirmed() ) { $errors[] = array( 'confirmedittext' ); @@ -2056,38 +2056,8 @@ class Title { // Don't block the user from editing their own talk page unless they've been // explicitly blocked from that too. } elseif ( $user->isBlocked() && $user->mBlock->prevents( $action ) !== false ) { - $block = $user->getBlock(); - - // This is from OutputPage::blockedPage - // Copied at r23888 by werdna - - $id = $user->blockedBy(); - $reason = $user->blockedFor(); - if ( $reason == '' ) { - $reason = wfMessage( 'blockednoreason' )->text(); - } - $ip = $user->getRequest()->getIP(); - - if ( is_numeric( $id ) ) { - $name = User::whoIs( $id ); - } else { - $name = $id; - } - - $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]"; - $blockid = $block->getId(); - $blockExpiry = $block->getExpiry(); - $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $block->mTimestamp ), true ); - if ( $blockExpiry == 'infinity' ) { - $blockExpiry = wfMessage( 'infiniteblock' )->text(); - } else { - $blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true ); - } - - $intended = strval( $block->getTarget() ); - - $errors[] = array( ( $block->mAuto ? 'autoblockedtext' : 'blockedtext' ), $link, $reason, $ip, $name, - $blockid, $blockExpiry, $intended, $blockTimestamp ); + // @todo FIXME: Pass the relevant context into this function. + $errors[] = $user->getBlock()->getPermissionsError( RequestContext::getMain() ); } return $errors; @@ -4431,7 +4401,7 @@ class Title { return true; // any interwiki link might be viewable, for all we know } - switch( $this->mNamespace ) { + switch ( $this->mNamespace ) { case NS_MEDIA: case NS_FILE: // file exists, possibly in a foreign repo