Deprecate SpecialPage::getTitle
authorKunal Mehta <legoktm@gmail.com>
Tue, 24 Dec 2013 08:07:04 +0000 (00:07 -0800)
committerKunal Mehta <legoktm@gmail.com>
Tue, 24 Dec 2013 20:53:11 +0000 (12:53 -0800)
Callers should use SpecialPage::getPageTitle, which is
exactly identical.

This is so that in the future we can turn SpecialPage
into a ContextSource, which requires getTitle to return
getContext()->getTitle.

Change-Id: Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40

43 files changed:
RELEASE-NOTES-1.23
includes/QueryPage.php
includes/SpecialPageFactory.php
includes/actions/RevisiondeleteAction.php
includes/specialpage/SpecialPage.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialBooksources.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialConfirmemail.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialEmailuser.php
includes/specials/SpecialExpandTemplates.php
includes/specials/SpecialExport.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialImport.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPreferences.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRandomInCategory.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php
includes/specials/SpecialWithoutinterwiki.php

index db80ad3..a54e57e 100644 (file)
@@ -126,6 +126,8 @@ changes to languages because of Bugzilla reports.
   and their definition was changed not to include the common*.css files;
   the two skins now load the 'skins.common.interface' module instead.
 * A page_links_updated field has been added to the page table.
+* SpecialPage::getTitle has been deprecated in favor of
+  SpecialPage::getPageTitle.
 
 == Compatibility ==
 
index a904c24..6d8a6bf 100644 (file)
@@ -547,7 +547,7 @@ abstract class QueryPage extends SpecialPage {
                                        min( $this->numRows, $this->limit ), # do not show the one extra row, if exist
                                        $this->offset + 1 )->parseAsBlock() );
                                # Disable the "next" link when we reach the end
-                               $paging = $this->getLanguage()->viewPrevNext( $this->getTitle( $par ), $this->offset,
+                               $paging = $this->getLanguage()->viewPrevNext( $this->getPageTitle( $par ), $this->offset,
                                        $this->limit, $this->linkParameters(), ( $this->numRows <= $this->limit ) );
                                $out->addHTML( '<p>' . $paging . '</p>' );
                        } else {
@@ -749,7 +749,7 @@ abstract class QueryPage extends SpecialPage {
        }
 
        function feedUrl() {
-               return $this->getTitle()->getFullURL();
+               return $this->getPageTitle()->getFullURL();
        }
 }
 
index aa5ac87..2cd9a3a 100644 (file)
@@ -466,13 +466,13 @@ class SpecialPageFactory {
                        if ( $name != $page->getLocalName() && !$context->getRequest()->wasPosted() ) {
                                $query = $context->getRequest()->getQueryValues();
                                unset( $query['title'] );
-                               $title = $page->getTitle( $par );
+                               $title = $page->getPageTitle( $par );
                                $url = $title->getFullURL( $query );
                                $context->getOutput()->redirect( $url );
                                wfProfileOut( __METHOD__ );
                                return $title;
                        } else {
-                               $context->setTitle( $page->getTitle( $par ) );
+                               $context->setTitle( $page->getPageTitle( $par ) );
                        }
 
                } elseif ( !$page->isIncludable() ) {
index 1803629..b6eeb7b 100644 (file)
@@ -49,7 +49,7 @@ class RevisiondeleteAction extends FormlessAction {
        public function show() {
                $special = SpecialPageFactory::getPage( 'Revisiondelete' );
                $special->setContext( $this->getContext() );
-               $special->getContext()->setTitle( $special->getTitle() );
+               $special->getContext()->setTitle( $special->getPageTitle() );
                $special->run( '' );
        }
 }
index 392d04b..41b6435 100644 (file)
@@ -27,6 +27,7 @@
  * Includes some static functions for handling the special page list deprecated
  * in favor of SpecialPageFactory.
  *
+ * @todo Turn this into a real ContextSource
  * @ingroup SpecialPage
  */
 class SpecialPage {
@@ -629,7 +630,7 @@ class SpecialPage {
                                        SpecialPage::getTitleFor( 'Userlogin' ),
                                        $this->msg( 'loginreqlink' )->escaped(),
                                        array(),
-                                       array( 'returnto' => $this->getTitle()->getPrefixedText() )
+                                       array( 'returnto' => $this->getPageTitle()->getPrefixedText() )
                                );
                                $reasonMsg = $this->msg( $reasonMsg )->rawParams( $loginreqlink );
                        }
@@ -768,8 +769,20 @@ class SpecialPage {
         *
         * @param $subpage String|Bool
         * @return Title object
+        * @deprecated in 1.23, use SpecialPage::getPageTitle
         */
        function getTitle( $subpage = false ) {
+               wfDeprecated( __METHOD__, '1.23' );
+               return $this->getPageTitle( $subpage );
+       }
+
+       /**
+        * Get a self-referential title object
+        *
+        * @param $subpage String|Bool
+        * @return Title object
+        */
+       function getPageTitle( $subpage = false ) {
                return self::getTitleFor( $this->mName, $subpage );
        }
 
index 388705d..1e2d557 100644 (file)
@@ -123,7 +123,7 @@ class SpecialAllpages extends IncludableSpecialPage {
         */
        function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '', $hideredirects = false ) {
                global $wgScript;
-               $t = $this->getTitle();
+               $t = $this->getPageTitle();
 
                $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
                $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
@@ -302,7 +302,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        $nsForm .
                                        '</td>
                                                        <td class="mw-allpages-nav">' .
-                                       Linker::link( $this->getTitle(), $this->msg( 'allpages' )->escaped(),
+                                       Linker::link( $this->getPageTitle(), $this->msg( 'allpages' )->escaped(),
                                                array(), array(), 'known' ) .
                                        "</td>
                                                </tr>" .
@@ -346,7 +346,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        $queryParams['hideredirects'] = 1;
                }
 
-               $url = $this->getTitle()->getLocalURL( $queryParams );
+               $url = $this->getPageTitle()->getLocalURL( $queryParams );
                $inlink = Html::element( 'a', array( 'href' => $url ), $inpointf );
                $outlink = Html::element( 'a', array( 'href' => $url ), $outpointf );
 
@@ -480,7 +480,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                }
                        }
 
-                       $self = $this->getTitle();
+                       $self = $this->getPageTitle();
 
                        $nsForm = $this->namespaceForm( $namespace, $from, $to, $hideredirects );
                        $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ) .
index 4e4db11..4e7043d 100644 (file)
@@ -97,7 +97,7 @@ class SpecialBlockList extends SpecialPage {
                        ),
                );
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle() ); // Remove subpage
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
                $form = new HTMLForm( $fields, $context );
                $form->setMethod( 'get' );
                $form->setWrapperLegendMsg( 'ipblocklist-legend' );
index 5ad961c..7b6cca0 100644 (file)
@@ -120,7 +120,7 @@ class SpecialBookSources extends SpecialPage {
                $form = Html::openElement( 'fieldset' ) . "\n";
                $form .= Html::element( 'legend', array(), $this->msg( 'booksources-search-legend' )->text() ) . "\n";
                $form .= Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . "\n";
-               $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
+               $form .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) . "\n";
                $form .= '<p>' . Xml::inputLabel( $this->msg( 'booksources-isbn' )->text(), 'isbn', 'isbn', 20, $this->isbn, array( 'autofocus' => true ) );
                $form .= '&#160;' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . "</p>\n";
                $form .= Html::closeElement( 'form' ) . "\n";
index e1531cc..d9ef5d7 100644 (file)
@@ -148,7 +148,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                                Xml::openElement( 'form',
                                        array(
                                                'method' => 'post',
-                                               'action' => $this->getTitle()->getLocalURL(),
+                                               'action' => $this->getPageTitle()->getLocalURL(),
                                                'id' => 'mw-changeemail-form' ) ) . "\n" .
                                Html::hidden( 'token', $user->getEditToken() ) . "\n" .
                                Html::hidden( 'returnto', $this->getRequest()->getVal( 'returnto' ) ) . "\n" .
index 43a4d2c..4b62990 100644 (file)
@@ -166,7 +166,7 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                                Xml::openElement( 'form',
                                        array(
                                                'method' => 'post',
-                                               'action' => $this->getTitle()->getLocalURL(),
+                                               'action' => $this->getPageTitle()->getLocalURL(),
                                                'id' => 'mw-resetpass-form' ) ) . "\n" .
                                $hiddenFieldsStr .
                                $this->msg( 'resetpass_text' )->parseAsBlock() . "\n" .
index bef155c..d771589 100644 (file)
@@ -101,7 +101,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
                        $out->addWikiMsg( 'confirmemail_text' );
                        $form = Html::openElement(
                                'form',
-                               array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL() )
+                               array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL() )
                        ) . "\n";
                        $form .= Html::hidden( 'token', $user->getEditToken() ) . "\n";
                        $form .= Xml::submitButton( $this->msg( 'confirmemail_send' )->text() ) . "\n";
index 551b972..262e238 100644 (file)
@@ -354,7 +354,7 @@ class SpecialContributions extends SpecialPage {
        protected function getForm() {
                global $wgScript;
 
-               $this->opts['title'] = $this->getTitle()->getPrefixedText();
+               $this->opts['title'] = $this->getPageTitle()->getPrefixedText();
                if ( !isset( $this->opts['target'] ) ) {
                        $this->opts['target'] = '';
                } else {
index 9b9888a..d148a50 100644 (file)
@@ -495,7 +495,7 @@ class DeletedContributionsPage extends SpecialPage {
        function getForm( $options ) {
                global $wgScript;
 
-               $options['title'] = $this->getTitle()->getPrefixedText();
+               $options['title'] = $this->getPageTitle()->getPrefixedText();
                if ( !isset( $options['target'] ) ) {
                        $options['target'] = '';
                } else {
index daa56b3..98d5fea 100644 (file)
@@ -534,7 +534,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                }
 
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle() ); // Remove subpage
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
                $form = new EditWatchlistNormalHTMLForm( $fields, $context );
                $form->setSubmitTextMsg( 'watchlistedit-normal-submit' );
                # Used message keys: 'accesskey-watchlistedit-normal-submit', 'tooltip-watchlistedit-normal-submit'
@@ -598,7 +598,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        ),
                );
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle( 'raw' ) ); // Reset subpage
+               $context->setTitle( $this->getPageTitle( 'raw' ) ); // Reset subpage
                $form = new HTMLForm( $fields, $context );
                $form->setSubmitTextMsg( 'watchlistedit-raw-submit' );
                # Used message keys: 'accesskey-watchlistedit-raw-submit', 'tooltip-watchlistedit-raw-submit'
index 2e90d99..908e59c 100644 (file)
@@ -149,7 +149,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                $this->mTargetObj = $ret;
 
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle() ); // Remove subpage
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
                $form = new HTMLForm( $this->getFormFields(), $context );
                // By now we are supposed to be sure that $this->mTarget is a user name
                $form->addPreText( $this->msg( 'emailpagetext', $this->mTarget )->parse() );
@@ -260,7 +260,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        'form',
                        array( 'method' => 'get', 'action' => $wgScript, 'id' => 'askusername' )
                ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+                       Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
                        Xml::openElement( 'fieldset' ) .
                        Html::rawElement( 'legend', null, $this->msg( 'emailtarget' )->parse() ) .
                        Xml::inputLabel(
index 19d7a6b..7241105 100644 (file)
@@ -61,7 +61,7 @@ class SpecialExpandTemplates extends SpecialPage {
                $title = Title::newFromText( $titleStr );
 
                if ( !$title ) {
-                       $title = $this->getTitle();
+                       $title = $this->getPageTitle();
                }
                $input = $request->getText( 'wpInput' );
                $this->generateXML = $request->getBool( 'wpGenerateXml' );
@@ -138,7 +138,7 @@ class SpecialExpandTemplates extends SpecialPage {
         * @return string
         */
        private function makeForm( $title, $input ) {
-               $self = $this->getTitle();
+               $self = $this->getPageTitle();
                $form = Xml::openElement(
                        'form',
                        array( 'method' => 'post', 'action' => $self->getLocalUrl() )
index 61ed34d..bbed9e6 100644 (file)
@@ -185,7 +185,7 @@ class SpecialExport extends SpecialPage {
                $out->addWikiMsg( 'exporttext' );
 
                $form = Xml::openElement( 'form', array( 'method' => 'post',
-                       'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ) );
+                       'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ) ) );
                $form .= Xml::inputLabel(
                        $this->msg( 'export-addcattext' )->text(),
                        'catname',
index 4c6593b..9cf5a73 100644 (file)
@@ -117,7 +117,7 @@ class FileDuplicateSearchPage extends QueryPage {
                                'form',
                                array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript )
                        ) . "\n" .
-                               Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
+                               Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) . "\n" .
                                Html::openElement( 'fieldset' ) . "\n" .
                                Html::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . "\n" .
                                Xml::inputLabel(
index 1bc6c92..2ac34eb 100644 (file)
@@ -64,11 +64,11 @@ class SpecialImport extends SpecialPage {
                # @todo FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
                # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
                $errors = wfMergeErrorArrays(
-                       $this->getTitle()->getUserPermissionsErrors(
+                       $this->getPageTitle()->getUserPermissionsErrors(
                                'import', $user, true,
                                array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
                        ),
-                       $this->getTitle()->getUserPermissionsErrors(
+                       $this->getPageTitle()->getUserPermissionsErrors(
                                'importupload', $user, true,
                                array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
                        )
@@ -203,7 +203,7 @@ class SpecialImport extends SpecialPage {
        private function showForm() {
                global $wgImportSources, $wgExportMaxLinkDepth;
 
-               $action = $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) );
+               $action = $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) );
                $user = $this->getUser();
                $out = $this->getOutput();
 
index 7069d52..57d314f 100644 (file)
@@ -68,7 +68,7 @@ class SpecialJavaScriptTest extends SpecialPage {
                                $this->msg( "javascripttest-$framework-name" )->plain()
                        ) );
                        $out->setSubtitle( $this->msg( 'javascripttest-backlink' )
-                               ->rawParams( Linker::linkKnown( $this->getTitle() ) ) );
+                               ->rawParams( Linker::linkKnown( $this->getPageTitle() ) ) );
                        $this->{self::$frameworks[$framework]}();
                } else {
                        // Framework not found, display error
@@ -97,7 +97,7 @@ class SpecialJavaScriptTest extends SpecialPage {
                                'li',
                                array(),
                                Linker::link(
-                                       $this->getTitle( $framework ),
+                                       $this->getPageTitle( $framework ),
                                        // Message: javascripttest-qunit-name
                                        $this->msg( "javascripttest-$framework-name" )->escaped()
                                )
index 5c121ba..0b5b825 100644 (file)
@@ -86,7 +86,7 @@ class LinkSearchPage extends QueryPage {
                        'form',
                        array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript )
                ) . "\n" .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
+                       Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) . "\n" .
                        Html::openElement( 'fieldset' ) . "\n" .
                        Html::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . "\n" .
                        Xml::inputLabel(
index 3eeae31..dd78c4c 100644 (file)
@@ -112,7 +112,7 @@ class MIMEsearchPage extends QueryPage {
                                array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript )
                        ) .
                                Xml::openElement( 'fieldset' ) .
-                               Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+                               Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
                                Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
                                Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $mime ) .
                                ' ' .
index fb5ea65..f799fc5 100644 (file)
@@ -142,7 +142,7 @@ class SpecialMergeHistory extends SpecialPage {
                                '<fieldset>' .
                                Xml::element( 'legend', array(),
                                        $this->msg( 'mergehistory-box' )->text() ) .
-                               Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
+                               Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
                                Html::hidden( 'submitted', '1' ) .
                                Html::hidden( 'mergepoint', $this->mTimestamp ) .
                                Xml::openElement( 'table' ) .
@@ -171,7 +171,7 @@ class SpecialMergeHistory extends SpecialPage {
                $haveRevisions = $revisions && $revisions->getNumRows() > 0;
 
                $out = $this->getOutput();
-               $titleObj = $this->getTitle();
+               $titleObj = $this->getPageTitle();
                $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
                # Start the form here
                $top = Xml::openElement(
index 253e6cc..e56723c 100644 (file)
@@ -281,7 +281,7 @@ class MovePageForm extends UnlistedSpecialPage {
                                'form',
                                array(
                                        'method' => 'post',
-                                       'action' => $this->getTitle()->getLocalURL( 'action=submit' ),
+                                       'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ),
                                        'id' => 'movepage'
                                )
                        ) .
index 006510d..1e631f9 100644 (file)
@@ -194,7 +194,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                $changed = $this->opts->getChangedValues();
                unset( $changed['offset'] ); // Reset offset if query type changes
 
-               $self = $this->getTitle();
+               $self = $this->getPageTitle();
                foreach ( $filters as $key => $msg ) {
                        $onoff = 1 - $this->opts->getValue( $key );
                        $link = Linker::link( $self, $showhide[$onoff], array(),
@@ -233,7 +233,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                }
 
                $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
+                       Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
                        Xml::fieldset( $this->msg( 'newpages' )->text() ) .
                        Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
                        '<tr>
@@ -430,7 +430,7 @@ class SpecialNewpages extends IncludableSpecialPage {
                $feed = new $wgFeedClasses[$type](
                        $this->feedTitle(),
                        $this->msg( 'tagline' )->text(),
-                       $this->getTitle()->getFullURL()
+                       $this->getPageTitle()->getFullURL()
                );
 
                $pager = new NewPagesPager( $this, $this->opts );
index 51454f6..4cfd445 100644 (file)
@@ -69,7 +69,7 @@ class SpecialPreferences extends SpecialPage {
                $this->getOutput()->addWikiMsg( 'prefs-reset-intro' );
 
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle( 'reset' ) ); // Reset subpage
+               $context->setTitle( $this->getPageTitle( 'reset' ) ); // Reset subpage
                $htmlForm = new HTMLForm( array(), $context, 'prefs-restore' );
 
                $htmlForm->setSubmitTextMsg( 'restoreprefs' );
@@ -88,7 +88,7 @@ class SpecialPreferences extends SpecialPage {
                $user->resetOptions( 'all', $this->getContext() );
                $user->saveSettings();
 
-               $url = $this->getTitle()->getFullURL( 'success' );
+               $url = $this->getPageTitle()->getFullURL( 'success' );
 
                $this->getOutput()->redirect( $url );
 
index 28d07ff..c6307f0 100644 (file)
@@ -101,7 +101,7 @@ class SpecialPrefixindex extends SpecialAllpages {
 
                $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
                $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
-               $out .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
+               $out .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
                $out .= Xml::openElement( 'fieldset' );
                $out .= Xml::element( 'legend', null, $this->msg( 'allpages' )->text() );
                $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
@@ -249,7 +249,7 @@ class SpecialPrefixindex extends SpecialAllpages {
                        $out2 = '';
                } else {
                        $nsForm = $this->namespacePrefixForm( $namespace, $prefix );
-                       $self = $this->getTitle();
+                       $self = $this->getPageTitle();
                        $out2 = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-nav-table' ) ) .
                                '<tr>
                                        <td>' .
index 3de6ea2..db3be12 100644 (file)
@@ -200,7 +200,7 @@ class SpecialProtectedpages extends SpecialPage {
        ) {
                global $wgScript;
 
-               $title = $this->getTitle();
+               $title = $this->getPageTitle();
 
                return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
                        Xml::openElement( 'fieldset' ) .
index 078e7b1..c3ebd80 100644 (file)
@@ -135,7 +135,7 @@ class SpecialProtectedtitles extends SpecialPage {
        function showOptions( $namespace, $type = 'edit', $level ) {
                global $wgScript;
                $action = htmlspecialchars( $wgScript );
-               $title = $this->getTitle();
+               $title = $this->getPageTitle();
                $special = htmlspecialchars( $title->getPrefixedDBkey() );
 
                return "<form action=\"$action\" method=\"get\">\n" .
index 14123a8..4e2f0e7 100644 (file)
@@ -101,7 +101,7 @@ class SpecialRandomInCategory extends SpecialPage {
 
                        $msg = $this->msg( 'randomincategory-selectcategory' );
                        $form = Html::rawElement( 'form', array( 'action' => $wgScript ),
-                               Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+                               Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
                                $msg->rawParams( $input, $submit )->parse()
                        );
                        $this->getOutput()->addHtml( $form );
index f866158..2288bf2 100644 (file)
@@ -189,7 +189,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $formatter = $changesFeed->getFeedObject(
                        $this->msg( 'recentchanges' )->inContentLanguage()->text(),
                        $this->msg( 'recentchanges-feed-description' )->inContentLanguage()->text(),
-                       $this->getTitle()->getFullURL()
+                       $this->getPageTitle()->getFullURL()
                );
 
                return array( $changesFeed, $formatter );
@@ -593,7 +593,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $out .= Html::hidden( $key, $value );
                }
 
-               $t = $this->getTitle();
+               $t = $this->getPageTitle();
                $out .= Html::hidden( 'title', $t->getPrefixedText() );
                $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
                $panel[] = $form;
@@ -862,7 +862,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $text = '<strong>' . $text . '</strong>';
                }
 
-               return Linker::linkKnown( $this->getTitle(), $text, array(), $params );
+               return Linker::linkKnown( $this->getPageTitle(), $text, array(), $params );
        }
 
        /**
index 1c3e05c..5dee226 100644 (file)
@@ -50,7 +50,7 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                        $this->msg( 'recentchangeslinked-title', $this->getTargetTitle()->getPrefixedText() )
                                ->inContentLanguage()->text(),
                        $this->msg( 'recentchangeslinked-feed' )->inContentLanguage()->text(),
-                       $this->getTitle()->getFullURL()
+                       $this->getPageTitle()->getFullURL()
                );
                return array( $feed, $feedObj );
        }
index 87705a8..96e063e 100644 (file)
@@ -272,7 +272,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        $this->getOutput()->addHTML(
                                Xml::openElement( 'form', array(
                                        'method' => 'POST',
-                                       'action' => $this->getTitle()->getLocalURL( array(
+                                       'action' => $this->getPageTitle()->getLocalURL( array(
                                                        'target' => $this->targetObj->getPrefixedDBkey(),
                                                        'file' => $archiveName,
                                                        'token' => $user->getEditToken( $archiveName ),
@@ -357,7 +357,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                // Show form if the user can submit
                if ( $this->mIsAllowed ) {
                        $out = Xml::openElement( 'form', array( 'method' => 'post',
-                                       'action' => $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) ),
+                                       'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ),
                                        'id' => 'mw-revdel-form-revisions' ) ) .
                                Xml::fieldset( $this->msg( 'revdelete-legend' )->text() ) .
                                $this->buildCheckBoxes() .
index 36ccaf8..62eeb40 100644 (file)
@@ -375,7 +375,7 @@ class SpecialSearch extends SpecialPage {
                if ( $num || $this->offset ) {
                        // Show the create link ahead
                        $this->showCreateLink( $t, $num );
-                       $prevnext = $this->getLanguage()->viewPrevNext( $this->getTitle(), $this->offset, $this->limit,
+                       $prevnext = $this->getLanguage()->viewPrevNext( $this->getPageTitle(), $this->offset, $this->limit,
                                $this->powerSearchOptions() + array( 'search' => $term ),
                                max( $titleMatchesNum, $textMatchesNum ) < $this->limit
                        );
@@ -1089,7 +1089,7 @@ class SpecialSearch extends SpecialPage {
         * @return string
         */
        protected function shortDialog( $term ) {
-               $out = Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
+               $out = Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
                $out .= Html::hidden( 'profile', $this->profile ) . "\n";
                // Term box
                $out .= Html::input( 'search', $term, 'search', array(
@@ -1134,7 +1134,7 @@ class SpecialSearch extends SpecialPage {
                return Xml::element(
                        'a',
                        array(
-                               'href' => $this->getTitle()->getLocalURL( $stParams ),
+                               'href' => $this->getPageTitle()->getLocalURL( $stParams ),
                                'title' => $tooltip
                        ),
                        $label
index 0042b43..3ed3ac3 100644 (file)
@@ -68,7 +68,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                                        $groups[$group] = array();
                                }
                                $groups[$group][$page->getDescription()] = array(
-                                       $page->getTitle(),
+                                       $page->getPageTitle(),
                                        $page->isRestricted(),
                                        $page->isCached()
                                );
index 264eb46..0dd5a0c 100644 (file)
@@ -809,7 +809,7 @@ class SpecialUndelete extends SpecialPage {
                $out->addHTML(
                        Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
                                Xml::fieldset( $this->msg( 'undelete-search-box' )->text() ) .
-                               Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
+                               Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
                                Html::rawElement(
                                        'label',
                                        array( 'for' => 'prefix' ),
@@ -849,7 +849,7 @@ class SpecialUndelete extends SpecialPage {
 
                $out->addWikiMsg( 'undeletepagetext', $this->getLanguage()->formatNum( $result->numRows() ) );
 
-               $undelete = $this->getTitle();
+               $undelete = $this->getPageTitle();
                $out->addHTML( "<ul>\n" );
                foreach ( $result as $row ) {
                        $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
@@ -932,7 +932,7 @@ class SpecialUndelete extends SpecialPage {
                }
 
                $link = Linker::linkKnown(
-                       $this->getTitle( $this->mTargetObj->getPrefixedDBkey() ),
+                       $this->getPageTitle( $this->mTargetObj->getPrefixedDBkey() ),
                        htmlspecialchars( $this->mTargetObj->getPrefixedText() )
                );
 
@@ -1015,7 +1015,7 @@ class SpecialUndelete extends SpecialPage {
                                        'style' => 'clear: both' ) ) .
                                Xml::openElement( 'form', array(
                                        'method' => 'post',
-                                       'action' => $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
+                                       'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
                                Xml::element( 'input', array(
                                        'type' => 'hidden',
                                        'name' => 'target',
@@ -1074,7 +1074,7 @@ class SpecialUndelete extends SpecialPage {
                $isDeleted = !( $rev->getId() && $rev->getTitle() );
                if ( $isDeleted ) {
                        /// @todo FIXME: $rev->getTitle() is null for deleted revs...?
-                       $targetPage = $this->getTitle();
+                       $targetPage = $this->getPageTitle();
                        $targetQuery = array(
                                'target' => $this->mTargetObj->getPrefixedText(),
                                'timestamp' => wfTimestamp( TS_MW, $rev->getTimestamp() )
@@ -1145,7 +1145,7 @@ class SpecialUndelete extends SpecialPage {
                $out->addHTML(
                        Xml::openElement( 'form', array(
                                        'method' => 'POST',
-                                       'action' => $this->getTitle()->getLocalURL( array(
+                                       'action' => $this->getPageTitle()->getLocalURL( array(
                                                'target' => $this->mTarget,
                                                'file' => $key,
                                                'token' => $user->getEditToken( $key ),
@@ -1233,7 +1233,7 @@ class SpecialUndelete extends SpecialPage {
                }
 
                if ( $this->mAllowed ) {
-                       $action = $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) );
+                       $action = $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) );
                        # Start the form here
                        $top = Xml::openElement(
                                'form',
@@ -1364,7 +1364,7 @@ class SpecialUndelete extends SpecialPage {
                // Build page & diff links...
                $user = $this->getUser();
                if ( $this->mCanView ) {
-                       $titleObj = $this->getTitle();
+                       $titleObj = $this->getPageTitle();
                        # Last link
                        if ( !$rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) {
                                $pageLink = htmlspecialchars( $this->getLanguage()->userTimeAndDate( $ts, $user ) );
@@ -1430,7 +1430,7 @@ class SpecialUndelete extends SpecialPage {
                if ( $this->mAllowed && $row->fa_storage_key ) {
                        $checkBox = Xml::check( 'fileid' . $row->fa_id );
                        $key = urlencode( $row->fa_storage_key );
-                       $pageLink = $this->getFileLink( $file, $this->getTitle(), $ts, $key );
+                       $pageLink = $this->getFileLink( $file, $this->getPageTitle(), $ts, $key );
                } else {
                        $checkBox = '';
                        $pageLink = $this->getLanguage()->userTimeAndDate( $ts, $user );
index 7c05001..5175ec9 100644 (file)
@@ -220,7 +220,7 @@ class SpecialUpload extends SpecialPage {
        protected function getUploadForm( $message = '', $sessionKey = '', $hideIgnoreWarning = false ) {
                # Initialize form
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle() ); // Remove subpage
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
                $form = new UploadForm( array(
                        'watch' => $this->getWatchCheck(),
                        'forreupload' => $this->mForReUpload,
index 1373df1..37bfa39 100644 (file)
@@ -346,7 +346,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                // this design is extremely dubious, but supposedly HTMLForm is our standard now?
 
                $context = new DerivativeContext( $this->getContext() );
-               $context->setTitle( $this->getTitle() ); // Remove subpage
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
                $form = new HTMLForm( array(
                        'Clear' => array(
                                'type' => 'hidden',
@@ -362,7 +362,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
 
                // show the files + form, if there are any, or just say there are none
                $refreshHtml = Html::element( 'a',
-                       array( 'href' => $this->getTitle()->getLocalURL() ),
+                       array( 'href' => $this->getPageTitle()->getLocalURL() ),
                        $this->msg( 'uploadstash-refresh' )->text() );
                $files = $this->stash->listFiles();
                if ( $files && count( $files ) ) {
@@ -372,7 +372,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                                // TODO: Use Linker::link or even construct the list in plain wikitext
                                $fileListItemsHtml .= Html::rawElement( 'li', array(),
                                        Html::element( 'a', array( 'href' =>
-                                               $this->getTitle( "file/$file" )->getLocalURL() ), $file )
+                                               $this->getPageTitle( "file/$file" )->getLocalURL() ), $file )
                                );
                        }
                        $this->getOutput()->addHtml( Html::rawElement( 'ul', array(), $fileListItemsHtml ) );
index d071e75..3a64014 100644 (file)
@@ -318,7 +318,7 @@ class LoginForm extends SpecialPage {
                        # Confirm that the account was created
                        $out->setPageTitle( $this->msg( 'accountcreated' ) );
                        $out->addWikiMsg( 'accountcreatedtext', $u->getName() );
-                       $out->addReturnTo( $this->getTitle() );
+                       $out->addReturnTo( $this->getPageTitle() );
                        wfRunHooks( 'AddNewAccount', array( $u, false ) );
                        $u->addNewUserLogEntry( 'create2', $this->mReason );
                }
@@ -390,7 +390,7 @@ class LoginForm extends SpecialPage {
                }
 
                # Include checks that will include GlobalBlocking (Bug 38333)
-               $permErrors = $this->getTitle()->getUserPermissionsErrors( 'createaccount', $currentUser, true );
+               $permErrors = $this->getPageTitle()->getUserPermissionsErrors( 'createaccount', $currentUser, true );
                if ( count( $permErrors ) ) {
                                throw new PermissionsError( 'createaccount', $permErrors );
                }
@@ -1075,7 +1075,7 @@ class LoginForm extends SpecialPage {
                global $wgAuth, $wgEmailConfirmToEdit, $wgCookieExpiration;
                global $wgSecureLogin, $wgPasswordResetRoutes;
 
-               $titleObj = $this->getTitle();
+               $titleObj = $this->getPageTitle();
                $user = $this->getUser();
                $out = $this->getOutput();
 
@@ -1431,7 +1431,7 @@ class LoginForm extends SpecialPage {
                $attr['lang'] = $attr['hreflang'] = $targetLanguage->getHtmlCode();
 
                return Linker::linkKnown(
-                       $this->getTitle(),
+                       $this->getPageTitle(),
                        htmlspecialchars( $text ),
                        $attr,
                        $query
index 4501736..014408e 100644 (file)
@@ -174,7 +174,7 @@ class UserrightsPage extends SpecialPage {
        }
 
        function getSuccessURL() {
-               return $this->getTitle( $this->mTarget )->getFullURL( array( 'success' => 1 ) );
+               return $this->getPageTitle( $this->mTarget )->getFullURL( array( 'success' => 1 ) );
        }
 
        /**
@@ -405,7 +405,7 @@ class UserrightsPage extends SpecialPage {
                global $wgScript;
                $this->getOutput()->addHTML(
                        Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) .
-                       Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+                       Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
                        Xml::fieldset( $this->msg( 'userrights-lookup-user' )->text() ) .
                        Xml::inputLabel( $this->msg( 'userrights-user-editname' )->text(), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ), array( 'autofocus' => true ) ) . ' ' .
                        Xml::submitButton( $this->msg( 'editusergroup' )->text() ) .
@@ -490,7 +490,7 @@ class UserrightsPage extends SpecialPage {
                );
 
                $this->getOutput()->addHTML(
-                       Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) .
+                       Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) .
                        Html::hidden( 'user', $this->mTarget ) .
                        Html::hidden( 'wpEditToken', $this->getUser()->getEditToken( $this->mTarget ) ) .
                        Html::hidden( 'conflictcheck-originalgroups', implode( ',', $user->getGroups() ) ) . // Conflict detection
index 4d86744..1f4d46f 100644 (file)
@@ -159,7 +159,7 @@ class SpecialWatchlist extends SpecialPage {
                        && $request->wasPosted()
                ) {
                        $user->clearAllNotifications();
-                       $output->redirect( $this->getTitle()->getFullURL( $nondefaults ) );
+                       $output->redirect( $this->getPageTitle()->getFullURL( $nondefaults ) );
                        return;
                }
 
@@ -236,7 +236,7 @@ class SpecialWatchlist extends SpecialPage {
 
                if ( $wgShowUpdatedMarker ) {
                        $form .= Xml::openElement( 'form', array( 'method' => 'post',
-                               'action' => $this->getTitle()->getLocalURL(),
+                               'action' => $this->getPageTitle()->getLocalURL(),
                                'id' => 'mw-watchlist-resetbutton' ) ) . "\n" .
                        Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) . "\n" .
                        Html::hidden( 'reset', 'all' ) . "\n";
@@ -248,7 +248,7 @@ class SpecialWatchlist extends SpecialPage {
 
                $form .= Xml::openElement( 'form', array(
                        'method' => 'post',
-                       'action' => $this->getTitle()->getLocalURL(),
+                       'action' => $this->getPageTitle()->getLocalURL(),
                        'id' => 'mw-watchlist-form'
                ) );
                $form .= Xml::fieldset(
@@ -437,14 +437,14 @@ class SpecialWatchlist extends SpecialPage {
                $label = $this->msg( $value ? 'show' : 'hide' )->escaped();
                $options[$name] = 1 - (int)$value;
 
-               return $this->msg( $message )->rawParams( Linker::linkKnown( $this->getTitle(), $label, array(), $options ) )->escaped();
+               return $this->msg( $message )->rawParams( Linker::linkKnown( $this->getPageTitle(), $label, array(), $options ) )->escaped();
        }
 
        protected function hoursLink( $h, $options = array() ) {
                $options['days'] = ( $h / 24.0 );
 
                return Linker::linkKnown(
-                       $this->getTitle(),
+                       $this->getPageTitle(),
                        $this->getLanguage()->formatNum( $h ),
                        array(),
                        $options
@@ -456,7 +456,7 @@ class SpecialWatchlist extends SpecialPage {
                $message = ( $d ? $this->getLanguage()->formatNum( $d ) : $this->msg( 'watchlistall2' )->escaped() );
 
                return Linker::linkKnown(
-                       $this->getTitle(),
+                       $this->getPageTitle(),
                        $message,
                        array(),
                        $options
index 05c7dd5..3f9b98d 100644 (file)
@@ -84,7 +84,7 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                $this->getSkin()->setRelevantTitle( $this->target );
 
-               $this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() );
+               $this->selfTitle = $this->getPageTitle( $this->target->getPrefixedDBkey() );
 
                $out->setPageTitle( $this->msg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
                $out->addBacklinkSubtitle( $this->target );
@@ -342,7 +342,7 @@ class SpecialWhatLinksHere extends SpecialPage {
        protected function wlhLink( Title $target, $text ) {
                static $title = null;
                if ( $title === null ) {
-                       $title = $this->getTitle();
+                       $title = $this->getPageTitle();
                }
 
                return Linker::linkKnown(
@@ -407,7 +407,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $f = Xml::openElement( 'form', array( 'action' => $wgScript ) );
 
                # Values that should not be forgotten
-               $f .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
+               $f .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
                foreach ( $this->opts->getUnconsumedValues() as $name => $value ) {
                        $f .= Html::hidden( $name, $value );
                }
index 9d23499..2ddde43 100644 (file)
@@ -49,7 +49,7 @@ class WithoutInterwikiPage extends PageQueryPage {
                }
 
                $prefix = $this->prefix;
-               $t = $this->getTitle();
+               $t = $this->getPageTitle();
 
                return Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . "\n" .
                        Html::openElement( 'fieldset' ) . "\n" .