'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',
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 '';
- }
-}
+}
\ No newline at end of file
}
if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) {
- $ret = new BadTitle;
+ $ret = SpecialPage::getTitleFor( 'Badtitle' );
}
return $ret;
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
// 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' );
}
'Allmessages' => array( 'AllMessages' ),
'Allpages' => array( 'AllPages' ),
'Ancientpages' => array( 'AncientPages' ),
+ 'Badtitle' => array( 'Badtitle' ),
'Blankpage' => array( 'BlankPage' ),
'Block' => array( 'Block', 'BlockIP', 'BlockUser' ),
'Blockme' => array( 'BlockMe' ),