From cd4dd7ca8518a157ade47b136d60038a4f71c4f1 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 9 Mar 2013 21:14:22 +0100 Subject: [PATCH] Correct case of Title::getPrefixedDBkey() calls Change-Id: Ic9ef0cc6dbb0a8eb0ee93432299ef59759223e2c --- includes/Import.php | 2 +- includes/OutputPage.php | 6 +++--- includes/SkinTemplate.php | 2 +- includes/Title.php | 2 +- includes/Wiki.php | 2 +- includes/actions/HistoryAction.php | 6 +++--- includes/api/ApiQueryBase.php | 2 +- includes/cache/LinkCache.php | 10 +++++----- includes/logging/LogFormatter.php | 2 +- includes/specials/SpecialFileDuplicateSearch.php | 2 +- includes/specials/SpecialLinkSearch.php | 2 +- includes/specials/SpecialMergeHistory.php | 2 +- includes/specials/SpecialUndelete.php | 4 ++-- maintenance/cleanupTitles.php | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/includes/Import.php b/includes/Import.php index 15e6620556..25f2f09162 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -225,7 +225,7 @@ class WikiImporter { } else { // set namespace to 'all', so the namespace check in processTitle() can passed $this->setTargetNamespace( null ); - $this->mTargetRootPage = $title->getPrefixedDBKey(); + $this->mTargetRootPage = $title->getPrefixedDBkey(); } } } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6bcc62568c..38ba1cbb70 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3008,7 +3008,7 @@ $templates 'wgCanonicalNamespace' => $nsname, 'wgCanonicalSpecialPageName' => $canonicalName, 'wgNamespaceNumber' => $title->getNamespace(), - 'wgPageName' => $title->getPrefixedDBKey(), + 'wgPageName' => $title->getPrefixedDBkey(), 'wgTitle' => $title->getText(), 'wgCurRevisionId' => $latestRevID, 'wgArticleId' => $pageID, @@ -3024,7 +3024,7 @@ $templates 'wgDefaultDateFormat' => $lang->getDefaultDateFormat(), 'wgMonthNames' => $lang->getMonthNamesArray(), 'wgMonthNamesShort' => $lang->getMonthAbbreviationsArray(), - 'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(), + 'wgRelevantPageName' => $relevantTitle->getPrefixedDBkey(), ); if ( $user->isLoggedIn() ) { $vars['wgUserId'] = $user->getId(); @@ -3042,7 +3042,7 @@ $templates $vars['wgIsMainPage'] = true; } if ( $this->mRedirectedFrom ) { - $vars['wgRedirectedFrom'] = $this->mRedirectedFrom->getPrefixedDBKey(); + $vars['wgRedirectedFrom'] = $this->mRedirectedFrom->getPrefixedDBkey(); } // Allow extensions to add their custom variables to the mw.config map. diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index e1aec17f03..d6ca545b0b 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -262,7 +262,7 @@ class SkinTemplate extends Skin { $tpl->set( 'helppage', $this->msg( 'helppage' )->text() ); */ $tpl->set( 'searchaction', $this->escapeSearchLink() ); - $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBKey() ); + $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() ); $tpl->set( 'search', trim( $request->getVal( 'search' ) ) ); $tpl->setRef( 'stylepath', $wgStylePath ); $tpl->setRef( 'articlepath', $wgArticlePath ); diff --git a/includes/Title.php b/includes/Title.php index 46b0524c9e..b001edc9ae 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2140,7 +2140,7 @@ class Title { # Time to check the whitelist # Only do these checks is there's something to check against $name = $this->getPrefixedText(); - $dbName = $this->getPrefixedDBKey(); + $dbName = $this->getPrefixedDBkey(); // Check for explicit whitelisting with and without underscores if ( in_array( $name, $wgWhitelistRead, true ) || in_array( $dbName, $wgWhitelistRead, true ) ) { diff --git a/includes/Wiki.php b/includes/Wiki.php index 6e1795d482..f8f699c91c 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -247,7 +247,7 @@ class MediaWiki { // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant } elseif ( $request->getVal( 'action', 'view' ) == 'view' && !$request->wasPosted() && ( $request->getVal( 'title' ) === null || - $title->getPrefixedDBKey() != $request->getVal( 'title' ) ) + $title->getPrefixedDBkey() != $request->getVal( 'title' ) ) && !count( $request->getValueNames( array( 'action', 'title' ) ) ) && wfRunHooks( 'TestCanonicalRedirect', array( $request, $title, $output ) ) ) { diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 20eb30783a..a5b7acef28 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -174,7 +174,7 @@ class HistoryAction extends FormlessAction { false, array( 'id' => 'mw-history-search' ) ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n" . + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" . Html::hidden( 'action', 'history' ) . "\n" . Xml::dateMenu( ( $year == null ? date( "Y" ) : $year ), $month ) . ' ' . ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) . @@ -440,7 +440,7 @@ class HistoryPager extends ReverseChronologicalPager { $this->getOutput()->wrapWikiMsg( "
\n$1\n
", 'histlegend' ); $s = Html::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-history-compare' ) ) . "\n"; - $s .= Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . "\n"; + $s .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n"; $s .= Html::hidden( 'action', 'historysubmit' ) . "\n"; // Button container stored in $this->buttons for re-use in getEndBody() @@ -580,7 +580,7 @@ class HistoryPager extends ReverseChronologicalPager { // Otherwise, show the link... } else { $query = array( 'type' => 'revision', - 'target' => $this->getTitle()->getPrefixedDbkey(), 'ids' => $rev->getId() ); + 'target' => $this->getTitle()->getPrefixedDBkey(), 'ids' => $rev->getId() ); $del .= Linker::revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); } diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 1423c731d2..94818095e0 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -419,7 +419,7 @@ abstract class ApiQueryBase extends ApiBase { if ( !$t ) { $this->dieUsageMsg( array( 'invalidtitle', $title ) ); } - return $t->getPrefixedDbKey(); + return $t->getPrefixedDBkey(); } /** diff --git a/includes/cache/LinkCache.php b/includes/cache/LinkCache.php index 623f545605..4a93b4526d 100644 --- a/includes/cache/LinkCache.php +++ b/includes/cache/LinkCache.php @@ -78,7 +78,7 @@ class LinkCache { * @return mixed */ public function getGoodLinkFieldObj( $title, $field ) { - $dbkey = $title->getPrefixedDbKey(); + $dbkey = $title->getPrefixedDBkey(); if ( array_key_exists( $dbkey, $this->mGoodLinkFields ) ) { return $this->mGoodLinkFields[$dbkey][$field]; } else { @@ -105,7 +105,7 @@ class LinkCache { * @param $model Integer: latest revision's content model ID */ public function addGoodLinkObj( $id, $title, $len = -1, $redir = null, $revision = false, $model = false ) { - $dbkey = $title->getPrefixedDbKey(); + $dbkey = $title->getPrefixedDBkey(); $this->mGoodLinks[$dbkey] = intval( $id ); $this->mGoodLinkFields[$dbkey] = array( 'length' => intval( $len ), @@ -122,7 +122,7 @@ class LinkCache { * page_latest and page_content_model */ public function addGoodLinkObjFromRow( $title, $row ) { - $dbkey = $title->getPrefixedDbKey(); + $dbkey = $title->getPrefixedDBkey(); $this->mGoodLinks[$dbkey] = intval( $row->page_id ); $this->mGoodLinkFields[$dbkey] = array( 'length' => intval( $row->page_len ), @@ -136,7 +136,7 @@ class LinkCache { * @param $title Title */ public function addBadLinkObj( $title ) { - $dbkey = $title->getPrefixedDbKey(); + $dbkey = $title->getPrefixedDBkey(); if ( !$this->isBadLink( $dbkey ) ) { $this->mBadLinks[$dbkey] = 1; } @@ -150,7 +150,7 @@ class LinkCache { * @param $title Title */ public function clearLink( $title ) { - $dbkey = $title->getPrefixedDbKey(); + $dbkey = $title->getPrefixedDBkey(); unset( $this->mBadLinks[$dbkey] ); unset( $this->mGoodLinks[$dbkey] ); unset( $this->mGoodLinkFields[$dbkey] ); diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 6c5b9835b8..8e5aff47a0 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -992,7 +992,7 @@ class DeleteLogFormatter extends LogFormatter { $this->msg( 'diff' )->escaped(), array(), array( - 'target' => $this->entry->getTarget()->getPrefixedDBKey(), + 'target' => $this->entry->getTarget()->getPrefixedDBkey(), 'diff' => 'prev', 'timestamp' => $ids[0] ) diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index bdf326300f..b9419f2d99 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -114,7 +114,7 @@ class FileDuplicateSearchPage extends QueryPage { # Create the input form $out->addHTML( Xml::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . Xml::inputLabel( $this->msg( 'fileduplicatesearch-filename' )->text(), 'filename', 'filename', 50, $this->filename ) . ' ' . diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 53625cf191..4779af23c6 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -89,7 +89,7 @@ class LinkSearchPage extends QueryPage { count( $protocols_list ) ); $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . '
' . Xml::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . Xml::inputLabel( $this->msg( 'linksearch-pat' )->text(), 'target', 'target', 50, $target ) . ' '; diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index c68f2dffa8..1476e156db 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -141,7 +141,7 @@ class SpecialMergeHistory extends SpecialPage { '
' . Xml::element( 'legend', array(), $this->msg( 'mergehistory-box' )->text() ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . Html::hidden( 'submitted', '1' ) . Html::hidden( 'mergepoint', $this->mTimestamp ) . Xml::openElement( 'table' ) . diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 160736996e..7baccde4a7 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -783,7 +783,7 @@ class SpecialUndelete extends SpecialPage { 'action' => $wgScript ) ) . Xml::fieldset( $this->msg( 'undelete-search-box' )->text() ) . Html::hidden( 'title', - $this->getTitle()->getPrefixedDbKey() ) . + $this->getTitle()->getPrefixedDBkey() ) . Xml::inputLabel( $this->msg( 'undelete-search-prefix' )->text(), 'prefix', 'prefix', 20, $this->mSearchPrefix ) . ' ' . @@ -967,7 +967,7 @@ class SpecialUndelete extends SpecialPage { Xml::element( 'input', array( 'type' => 'hidden', 'name' => 'target', - 'value' => $this->mTargetObj->getPrefixedDbKey() ) ) . + 'value' => $this->mTargetObj->getPrefixedDBkey() ) ) . Xml::element( 'input', array( 'type' => 'hidden', 'name' => 'timestamp', diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php index ad2577aa9d..66f9e87fe5 100644 --- a/maintenance/cleanupTitles.php +++ b/maintenance/cleanupTitles.php @@ -114,7 +114,7 @@ class TitleCleanup extends TableCleanup { protected function moveInconsistentPage( $row, $title ) { if ( $title->exists() || $title->getInterwiki() || !$title->canExist() ) { if ( $title->getInterwiki() || !$title->canExist() ) { - $prior = $title->getPrefixedDbKey(); + $prior = $title->getPrefixedDBkey(); } else { $prior = $title->getDBkey(); } -- 2.20.1