From 2d8a62941c59b533e212a0ff33324ed8cbd70e51 Mon Sep 17 00:00:00 2001 From: Huji Date: Mon, 14 Jan 2008 09:13:04 +0000 Subject: [PATCH] (bug 12608) Unifying the spelling of getDBkey() in the code. --- RELEASE-NOTES | 1 + includes/AjaxFunctions.php | 2 +- includes/CategoryPage.php | 2 +- includes/Revision.php | 10 +++++----- includes/SearchEngine.php | 2 +- includes/Skin.php | 4 ++-- includes/SkinTemplate.php | 2 +- includes/SpecialExport.php | 2 +- includes/SpecialRecentchangeslinked.php | 2 +- includes/SpecialUndelete.php | 10 +++++----- includes/Title.php | 10 +++++----- 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0e6a9e47a3..ddfb576d2f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -307,6 +307,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Use only default options when generating RSS and Atom syndication links. This should help prevent infinite link loops that some software may follow, and will generally keep feed behavior cleaner. +* (bug 12608) Unifying the spelling of getDBkey() in the code. == Parser changes in 1.12 == diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index 013771b0ab..b004cfc20f 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -90,7 +90,7 @@ function wfSajaxSearch( $term ) { $db = wfGetDB( DB_SLAVE ); $res = $db->select( 'page', array( 'page_title', 'page_namespace' ), array( 'page_namespace' => $term_title->getNamespace(), - "page_title LIKE '". $db->strencode( $term_title->getDBKey() ) ."%'" ), + "page_title LIKE '". $db->strencode( $term_title->getDBkey() ) ."%'" ), "wfSajaxSearch", array( 'LIMIT' => $limit+1 ) ); diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 656d3162fe..6fbcd3c17c 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -215,7 +215,7 @@ class CategoryViewer { array( 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey' ), array( $pageCondition, 'cl_from = page_id', - 'cl_to' => $this->title->getDBKey()), + 'cl_to' => $this->title->getDBkey()), #'page_is_redirect' => 0), #+ $pageCondition, __METHOD__, diff --git a/includes/Revision.php b/includes/Revision.php index 80fc03cdea..05a4a68ade 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -47,7 +47,7 @@ class Revision { array( "rev_id=$matchId", 'page_id=rev_page', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey() ) ); + 'page_title' => $title->getDBkey() ) ); } /** @@ -110,7 +110,7 @@ class Revision { array( "rev_id=$matchId", 'page_id=rev_page', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey() ) ); + 'page_title' => $title->getDBkey() ) ); } /** @@ -131,7 +131,7 @@ class Revision { array( 'rev_timestamp' => $db->timestamp( $timestamp ), 'page_id=rev_page', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey() ) ); + 'page_title' => $title->getDBkey() ) ); } /** @@ -190,7 +190,7 @@ class Revision { return Revision::fetchFromConds( wfGetDB( DB_SLAVE ), array( 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey(), + 'page_title' => $title->getDBkey(), 'page_id=rev_page' ) ); } @@ -209,7 +209,7 @@ class Revision { wfGetDB( DB_SLAVE ), array( 'rev_id=page_latest', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey(), + 'page_title' => $title->getDBkey(), 'page_id=rev_page' ) ); } diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 11fc3deb2e..9120da5312 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -109,7 +109,7 @@ class SearchEngine { # Entering an IP address goes to the contributions page if ( ( $title->getNamespace() == NS_USER && User::isIP($title->getText() ) ) || User::isIP( trim( $searchterm ) ) ) { - return SpecialPage::getTitleFor( 'Contributions', $title->getDbkey() ); + return SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ); } diff --git a/includes/Skin.php b/includes/Skin.php index 9d00e1d68d..64d8b3e8e6 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -310,7 +310,7 @@ class Skin extends Linker { 'wgScript' => $wgScript, 'wgServer' => $wgServer, 'wgCanonicalNamespace' => $nsname, - 'wgCanonicalSpecialPageName' => SpecialPage::resolveAlias( $wgTitle->getDBKey() ), + 'wgCanonicalSpecialPageName' => SpecialPage::resolveAlias( $wgTitle->getDBkey() ), 'wgNamespaceNumber' => $wgTitle->getNamespace(), 'wgPageName' => $wgTitle->getPrefixedDBKey(), 'wgTitle' => $wgTitle->getText(), @@ -1069,7 +1069,7 @@ END; $dbr = wfGetDB( DB_SLAVE ); $watchlist = $dbr->tableName( 'watchlist' ); $sql = "SELECT COUNT(*) AS n FROM $watchlist - WHERE wl_title='" . $dbr->strencode($wgTitle->getDBKey()) . + WHERE wl_title='" . $dbr->strencode($wgTitle->getDBkey()) . "' AND wl_namespace=" . $wgTitle->getNamespace() ; $res = $dbr->query( $sql, 'Skin::pageStats'); $x = $dbr->fetchObject( $res ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index d013119009..0178b86656 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -344,7 +344,7 @@ class SkinTemplate extends Skin { $dbr = wfGetDB( DB_SLAVE ); $watchlist = $dbr->tableName( 'watchlist' ); $sql = "SELECT COUNT(*) AS n FROM $watchlist - WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . + WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBkey()) . "' AND wl_namespace=" . $this->mTitle->getNamespace() ; $res = $dbr->query( $sql, 'SkinTemplate::outputPage'); $x = $dbr->fetchObject( $res ); diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index 12bd4d5c5b..71eb1221aa 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -24,7 +24,7 @@ function wfExportGetPagesFromCategory( $title ) { global $wgContLang; - $name = $title->getDBKey(); + $name = $title->getDBkey(); $dbr = wfGetDB( DB_SLAVE ); diff --git a/includes/SpecialRecentchangeslinked.php b/includes/SpecialRecentchangeslinked.php index ffb0a4d966..9bf957f952 100644 --- a/includes/SpecialRecentchangeslinked.php +++ b/includes/SpecialRecentchangeslinked.php @@ -76,7 +76,7 @@ function wfSpecialRecentchangeslinked( $par = NULL ) { // If target is a Category, use categorylinks and invert from and to if( $nt->getNamespace() == NS_CATEGORY ) { - $catkey = $dbr->addQuotes( $nt->getDBKey() ); + $catkey = $dbr->addQuotes( $nt->getDBkey() ); $sql = "SELECT /* wfSpecialRecentchangeslinked */ rc_id, rc_cur_id, diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 1fe11c1079..a64cfc22bd 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -57,7 +57,7 @@ class PageArchive { $title = Title::newFromText( $prefix ); if( $title ) { $ns = $title->getNamespace(); - $encPrefix = $dbr->escapeLike( $title->getDbKey() ); + $encPrefix = $dbr->escapeLike( $title->getDBkey() ); } else { // Prolly won't work too good // @todo handle bare namespace names cleanly? @@ -132,7 +132,7 @@ class PageArchive { 'fa_user', 'fa_user_text', 'fa_timestamp' ), - array( 'fa_name' => $this->title->getDbKey() ), + array( 'fa_name' => $this->title->getDBkey() ), __METHOD__, array( 'ORDER BY' => 'fa_timestamp DESC' ) ); $ret = $dbr->resultObject( $res ); @@ -174,7 +174,7 @@ class PageArchive { 'ar_text_id', 'ar_len' ), array( 'ar_namespace' => $this->title->getNamespace(), - 'ar_title' => $this->title->getDbkey(), + 'ar_title' => $this->title->getDBkey(), 'ar_timestamp' => $dbr->timestamp( $timestamp ) ), __METHOD__ ); if( $row ) { @@ -212,7 +212,7 @@ class PageArchive { $row = $dbr->selectRow( 'archive', 'ar_timestamp', array( 'ar_namespace' => $this->title->getNamespace(), - 'ar_title' => $this->title->getDbkey(), + 'ar_title' => $this->title->getDBkey(), 'ar_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $timestamp ) ) ), __METHOD__, @@ -225,7 +225,7 @@ class PageArchive { array( 'rev_id', 'rev_timestamp' ), array( 'page_namespace' => $this->title->getNamespace(), - 'page_title' => $this->title->getDbkey(), + 'page_title' => $this->title->getDBkey(), 'page_id = rev_page', 'rev_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $timestamp ) ) ), diff --git a/includes/Title.php b/includes/Title.php index 18e87ce94a..32f657551a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1263,7 +1263,7 @@ class Title { $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'protected_titles', '*', - array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBKey()) ); + array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBkey()) ); if ($row = $dbr->fetchRow( $res )) { return $row; @@ -1281,7 +1281,7 @@ class Title { return true; } - list ($namespace, $title) = array( $this->getNamespace(), $this->getDBKey() ); + list ($namespace, $title) = array( $this->getNamespace(), $this->getDBkey() ); $dbw = wfGetDB( DB_MASTER ); @@ -1323,7 +1323,7 @@ class Title { $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'protected_titles', - array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBKey()), __METHOD__ ); + array ('pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBkey()), __METHOD__ ); } /** @@ -1419,7 +1419,7 @@ class Title { * and check again */ if( $this->getNamespace() == NS_SPECIAL ) { - $name = $this->getDBKey(); + $name = $this->getDBkey(); list( $name, /* $subpage */) = SpecialPage::resolveAliasWithSubpage( $name ); if ( $name === false ) { # Invalid special page, but we show standard login required message @@ -2766,7 +2766,7 @@ class Title { // Note: === is necessary for proper matching of number-like titles. return $this->getInterwiki() === $title->getInterwiki() && $this->getNamespace() == $title->getNamespace() - && $this->getDbkey() === $title->getDbkey(); + && $this->getDBkey() === $title->getDBkey(); } /** -- 2.20.1