Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -24,7 +24,6 @@ |
25 | 25 | 'AuthPluginUser' => 'includes/AuthPlugin.php', |
26 | 26 | 'Autopromote' => 'includes/Autopromote.php', |
27 | 27 | 'BacklinkCache' => 'includes/BacklinkCache.php', |
28 | | - 'BadTitle' => 'includes/Title.php', |
29 | 28 | 'BaseTemplate' => 'includes/SkinTemplate.php', |
30 | 29 | 'Block' => 'includes/Block.php', |
31 | 30 | 'Category' => 'includes/Category.php', |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | } |
101 | 101 | |
102 | 102 | if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) { |
103 | | - $ret = new BadTitle; |
| 103 | + $ret = SpecialPage::getTitleFor( 'Badtitle' ); |
104 | 104 | } |
105 | 105 | |
106 | 106 | return $ret; |
— | — | @@ -147,7 +147,9 @@ |
148 | 148 | array( &$title, null, &$output, &$user, $request, $this ) ); |
149 | 149 | |
150 | 150 | // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty. |
151 | | - if ( $title instanceof BadTitle ) { |
| 151 | + if ( is_null( $title ) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) { |
| 152 | + $this->context->title = SpecialPage::getTitleFor( 'Badtitle' ); |
| 153 | + // Die now before we mess up $wgArticle and the skin stops working |
152 | 154 | throw new ErrorPageError( 'badtitle', 'badtitletext' ); |
153 | 155 | // If the user is not logged in, the Namespace:title of the article must be in |
154 | 156 | // the Read array in order for the user to see it. (We have to check here to |
— | — | @@ -171,7 +173,7 @@ |
172 | 174 | // 301 so google et al report the target as the actual url. |
173 | 175 | $output->redirect( $url, 301 ); |
174 | 176 | } else { |
175 | | - $this->context->setTitle( new BadTitle ); |
| 177 | + $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) ); |
176 | 178 | wfProfileOut( __METHOD__ ); |
177 | 179 | throw new ErrorPageError( 'badtitle', 'badtitletext' ); |
178 | 180 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -4369,38 +4369,4 @@ |
4370 | 4370 | wfRunHooks( 'PageContentLanguage', array( $this, &$pageLang, $wgLang ) ); |
4371 | 4371 | return wfGetLangObj( $pageLang ); |
4372 | 4372 | } |
4373 | | -} |
4374 | | - |
4375 | | -/** |
4376 | | - * A BadTitle is generated in MediaWiki::parseTitle() if the title is invalid; the |
4377 | | - * software uses this to display an error page. Internally it's basically a Title |
4378 | | - * for an empty special page |
4379 | | - */ |
4380 | | -class BadTitle extends Title { |
4381 | | - public function __construct(){ |
4382 | | - $this->mTextform = ''; |
4383 | | - $this->mUrlform = ''; |
4384 | | - $this->mDbkeyform = ''; |
4385 | | - $this->mNamespace = NS_SPECIAL; // Stops talk page link, etc, being shown |
4386 | | - } |
4387 | | - |
4388 | | - public function exists(){ |
4389 | | - return false; |
4390 | | - } |
4391 | | - |
4392 | | - public function getPrefixedText(){ |
4393 | | - return ''; |
4394 | | - } |
4395 | | - |
4396 | | - public function getText(){ |
4397 | | - return ''; |
4398 | | - } |
4399 | | - |
4400 | | - public function getPrefixedURL(){ |
4401 | | - return ''; |
4402 | | - } |
4403 | | - |
4404 | | - public function getPrefixedDBKey(){ |
4405 | | - return ''; |
4406 | | - } |
4407 | | -} |
| 4373 | +} |
\ No newline at end of file |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -365,6 +365,7 @@ |
366 | 366 | 'Allmessages' => array( 'AllMessages' ), |
367 | 367 | 'Allpages' => array( 'AllPages' ), |
368 | 368 | 'Ancientpages' => array( 'AncientPages' ), |
| 369 | + 'Badtitle' => array( 'Badtitle' ), |
369 | 370 | 'Blankpage' => array( 'BlankPage' ), |
370 | 371 | 'Block' => array( 'Block', 'BlockIP', 'BlockUser' ), |
371 | 372 | 'Blockme' => array( 'BlockMe' ), |
Index: trunk/extensions/CreateBox/CreateBox.php |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | $title = Title::newFromText( $prefix . $text ); |
65 | 65 | if( is_null( $title ) ) { |
66 | 66 | global $wgTitle; |
67 | | - $wgTitle = new BadTitle; |
| 67 | + $wgTitle = SpecialPage::getTitleFor( 'Badtitle' ); |
68 | 68 | throw new ErrorPageError( 'badtitle', 'badtitletext' ); |
69 | 69 | } elseif( $title->getArticleID() == 0 ) { |
70 | 70 | acRedirect( $title, 'edit' ); |