Undo r85392 ('revert' is a strong word since a lot has changed in the intervening ten thousand revisions, but the effect is the same).

This commit is contained in:
Happy-melon 2011-08-25 21:03:52 +00:00
parent 3313971781
commit d00052ebde
4 changed files with 7 additions and 39 deletions

View file

@ -24,7 +24,6 @@ $wgAutoloadLocalClasses = array(
'AuthPluginUser' => 'includes/AuthPlugin.php',
'Autopromote' => 'includes/Autopromote.php',
'BacklinkCache' => 'includes/BacklinkCache.php',
'BadTitle' => 'includes/Title.php',
'BaseTemplate' => 'includes/SkinTemplate.php',
'Block' => 'includes/Block.php',
'Category' => 'includes/Category.php',

View file

@ -4369,38 +4369,4 @@ class Title {
wfRunHooks( 'PageContentLanguage', array( $this, &$pageLang, $wgLang ) );
return wfGetLangObj( $pageLang );
}
}
/**
* A BadTitle is generated in MediaWiki::parseTitle() if the title is invalid; the
* software uses this to display an error page. Internally it's basically a Title
* for an empty special page
*/
class BadTitle extends Title {
public function __construct(){
$this->mTextform = '';
$this->mUrlform = '';
$this->mDbkeyform = '';
$this->mNamespace = NS_SPECIAL; // Stops talk page link, etc, being shown
}
public function exists(){
return false;
}
public function getPrefixedText(){
return '';
}
public function getText(){
return '';
}
public function getPrefixedURL(){
return '';
}
public function getPrefixedDBKey(){
return '';
}
}
}

View file

@ -99,7 +99,7 @@ class MediaWiki {
}
if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) {
$ret = new BadTitle;
$ret = SpecialPage::getTitleFor( 'Badtitle' );
}
return $ret;
@ -147,7 +147,9 @@ class MediaWiki {
array( &$title, null, &$output, &$user, $request, $this ) );
// Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
if ( $title instanceof BadTitle ) {
if ( is_null( $title ) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) {
$this->context->title = SpecialPage::getTitleFor( 'Badtitle' );
// Die now before we mess up $wgArticle and the skin stops working
throw new ErrorPageError( 'badtitle', 'badtitletext' );
// If the user is not logged in, the Namespace:title of the article must be in
// the Read array in order for the user to see it. (We have to check here to
@ -171,7 +173,7 @@ class MediaWiki {
// 301 so google et al report the target as the actual url.
$output->redirect( $url, 301 );
} else {
$this->context->setTitle( new BadTitle );
$this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
wfProfileOut( __METHOD__ );
throw new ErrorPageError( 'badtitle', 'badtitletext' );
}

View file

@ -365,6 +365,7 @@ $specialPageAliases = array(
'Allmessages' => array( 'AllMessages' ),
'Allpages' => array( 'AllPages' ),
'Ancientpages' => array( 'AncientPages' ),
'Badtitle' => array( 'Badtitle' ),
'Blankpage' => array( 'BlankPage' ),
'Block' => array( 'Block', 'BlockIP', 'BlockUser' ),
'Blockme' => array( 'BlockMe' ),