From 8e23949bee564bb8b5807be57e742d3c81cc043a Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 24 May 2009 08:29:10 +0000 Subject: [PATCH] Proper casing for getDBkey() --- includes/Article.php | 4 +-- includes/Category.php | 10 +++---- includes/LogPage.php | 2 +- includes/Title.php | 8 +++--- includes/api/ApiQueryBacklinks.php | 6 ++-- includes/api/ApiQueryCategoryInfo.php | 2 +- includes/api/ApiQueryInfo.php | 10 +++---- includes/filerepo/LocalFile.php | 4 +-- includes/filerepo/LocalRepo.php | 2 +- includes/parser/CoreParserFunctions.php | 2 +- includes/specials/SpecialAllpages.php | 4 +-- includes/specials/SpecialBlockip.php | 2 +- includes/specials/SpecialExport.php | 2 +- .../specials/SpecialFileDuplicateSearch.php | 2 +- .../specials/SpecialListUserRestrictions.php | 2 +- includes/specials/SpecialMovepage.php | 8 +++--- includes/specials/SpecialRevisiondelete.php | 28 +++++++++---------- 17 files changed, 49 insertions(+), 49 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index cbd3cfe624..033ecfc0aa 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -112,7 +112,7 @@ class Article { array( 'rd_from' => $this->getID(), 'rd_namespace' => $retval->getNamespace(), - 'rd_title' => $retval->getDBKey() + 'rd_title' => $retval->getDBkey() ), __METHOD__ ); @@ -2619,7 +2619,7 @@ class Article { $dbw->delete( 'recentchanges', array( 'rc_type != '.RC_LOG, 'rc_namespace' => $this->mTitle->getNamespace(), - 'rc_title' => $this->mTitle->getDBKey() ), + 'rc_title' => $this->mTitle->getDBkey() ), __METHOD__ ); $dbw->delete( 'recentchanges', array( 'rc_type != '.RC_LOG, 'rc_cur_id' => $id ), diff --git a/includes/Category.php b/includes/Category.php index 50efdbc1f4..611d087e33 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -26,7 +26,7 @@ class Category { */ protected function initialize() { if ( $this->mName === null && $this->mTitle ) - $this->mName = $title->getDBKey(); + $this->mName = $title->getDBkey(); if( $this->mName === null && $this->mID === null ) { throw new MWException( __METHOD__.' has both names and IDs null' ); @@ -50,7 +50,7 @@ class Category { if ( $this->mTitle ) { # If there is a title object but no record in the category table, treat this as an empty category $this->mID = false; - $this->mName = $this->mTitle->getDBKey(); + $this->mName = $this->mTitle->getDBkey(); $this->mPages = 0; $this->mSubcats = 0; $this->mFiles = 0; @@ -91,7 +91,7 @@ class Category { } $cat->mTitle = $title; - $cat->mName = $title->getDBKey(); + $cat->mName = $title->getDBkey(); return $cat; } @@ -106,7 +106,7 @@ class Category { $cat = new self(); $cat->mTitle = $title; - $cat->mName = $title->getDBKey(); + $cat->mName = $title->getDBkey(); return $cat; } @@ -149,7 +149,7 @@ class Category { # but we can't know that here... return false; } else { - $cat->mName = $title->getDBKey(); # if we have a title object, fetch the category name from there + $cat->mName = $title->getDBkey(); # if we have a title object, fetch the category name from there } $cat->mID = false; diff --git a/includes/LogPage.php b/includes/LogPage.php index 82ff8e273c..762e775ae4 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -332,7 +332,7 @@ class LogPage { break; default: if( $title->getNamespace() == NS_SPECIAL ) { - list( $name, $par ) = SpecialPage::resolveAliasWithSubpage( $title->getDBKey() ); + list( $name, $par ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() ); # Use the language name for log titles, rather than Log/X if( $name == 'Log' ) { $titleLink = '('.$skin->link( $title, LogPage::logName( $par ) ).')'; diff --git a/includes/Title.php b/includes/Title.php index f4c4641fe4..084ae71b05 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2599,7 +2599,7 @@ class Title { if( $nt->getText() != wfStripIllegalFilenameChars( $nt->getText() ) ) { $errors[] = array('imageinvalidfilename'); } - if( !File::checkExtensionCompatibility( $file, $nt->getDBKey() ) ) { + if( !File::checkExtensionCompatibility( $file, $nt->getDBkey() ) ) { $errors[] = array('imagetypemismatch'); } } @@ -3018,8 +3018,8 @@ class Title { // don't move it twice continue; $newPageName = preg_replace( - '#^'.preg_quote( $this->getDBKey(), '#' ).'#', - $nt->getDBKey(), $oldSubpage->getDBKey() ); + '#^'.preg_quote( $this->getDBkey(), '#' ).'#', + $nt->getDBkey(), $oldSubpage->getDBkey() ); if( $oldSubpage->isTalkPage() ) { $newNs = $nt->getTalkPage()->getNamespace(); } else { @@ -3381,7 +3381,7 @@ class Title { case NS_FILE: return wfFindFile( $this ); // file exists, possibly in a foreign repo case NS_SPECIAL: - return SpecialPage::exists( $this->getDBKey() ); // valid special page + return SpecialPage::exists( $this->getDBkey() ); // valid special page case NS_MAIN: return $this->mDbkeyform == ''; // selflink, possibly with fragment case NS_MEDIAWIKI: diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index b18986a7f2..4f23d6e501 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -110,7 +110,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { else $this->addFields($resultPageSet->getPageTableFields()); $this->addFields('page_is_redirect'); - $this->addWhereFld($this->bl_title, $this->rootTitle->getDBKey()); + $this->addWhereFld($this->bl_title, $this->rootTitle->getDBkey()); if($this->hasNS) $this->addWhereFld($this->bl_ns, $this->rootTitle->getNamespace()); $this->addWhereFld('page_namespace', $this->params['namespace']); @@ -143,14 +143,14 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { // We can't use LinkBatch here because $this->hasNS may be false $titleWhere = array(); foreach($this->redirTitles as $t) - $titleWhere[] = "{$this->bl_title} = ".$db->addQuotes($t->getDBKey()). + $titleWhere[] = "{$this->bl_title} = ".$db->addQuotes($t->getDBkey()). ($this->hasNS ? " AND {$this->bl_ns} = '{$t->getNamespace()}'" : ""); $this->addWhere($db->makeList($titleWhere, LIST_OR)); $this->addWhereFld('page_namespace', $this->params['namespace']); if(!is_null($this->redirID)) { $first = $this->redirTitles[0]; - $title = $db->strencode($first->getDBKey()); + $title = $db->strencode($first->getDBkey()); $ns = $first->getNamespace(); $from = $this->redirID; if($this->hasNS) diff --git a/includes/api/ApiQueryCategoryInfo.php b/includes/api/ApiQueryCategoryInfo.php index 9e36d93554..82e431aa96 100644 --- a/includes/api/ApiQueryCategoryInfo.php +++ b/includes/api/ApiQueryCategoryInfo.php @@ -53,7 +53,7 @@ class ApiQueryCategoryInfo extends ApiQueryBase { foreach($categories as $c) { $t = $titles[$c]; - $cattitles[$c] = $t->getDBKey(); + $cattitles[$c] = $t->getDBkey(); } $this->addTables(array('category', 'page', 'page_props')); diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 17c693e5b7..fab5ca2d72 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -301,10 +301,10 @@ class ApiQueryInfo extends ApiQueryBase { $this->protections[$title->getNamespace()][$title->getDBkey()]; $this->getResult()->setIndexedTagName($pageInfo['protection'], 'pr'); } - if($this->fld_talkid && isset($this->talkids[$title->getNamespace()][$title->getDBKey()])) - $pageInfo['talkid'] = $this->talkids[$title->getNamespace()][$title->getDBKey()]; - if($this->fld_subjectid && isset($this->subjectids[$title->getNamespace()][$title->getDBKey()])) - $pageInfo['subjectid'] = $this->subjectids[$title->getNamespace()][$title->getDBKey()]; + if($this->fld_talkid && isset($this->talkids[$title->getNamespace()][$title->getDBkey()])) + $pageInfo['talkid'] = $this->talkids[$title->getNamespace()][$title->getDBkey()]; + if($this->fld_subjectid && isset($this->subjectids[$title->getNamespace()][$title->getDBkey()])) + $pageInfo['subjectid'] = $this->subjectids[$title->getNamespace()][$title->getDBkey()]; if($this->fld_url) { $pageInfo['fullurl'] = $title->getFullURL(); $pageInfo['editurl'] = $title->getFullURL('action=edit'); @@ -404,7 +404,7 @@ class ApiQueryInfo extends ApiQueryBase { $images = $others = array(); foreach ($this->everything as $title) if ($title->getNamespace() == NS_FILE) - $images[] = $title->getDBKey(); + $images[] = $title->getDBkey(); else $others[] = $title; diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index d1ef4e2883..d87e7bb626 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -642,7 +642,7 @@ class LocalFile extends File $fields = OldLocalFile::selectFields(); $conds = $opts = $join_conds = array(); $eq = $inc ? "=" : ""; - $conds[] = "oi_name = " . $dbr->addQuotes( $this->title->getDBKey() ); + $conds[] = "oi_name = " . $dbr->addQuotes( $this->title->getDBkey() ); if( $start ) { $conds[] = "oi_timestamp <$eq " . $dbr->addQuotes( $dbr->timestamp( $start ) ); } @@ -1796,7 +1796,7 @@ class LocalFileMoveBatch { $this->file = $file; $this->target = $target; $this->oldHash = $this->file->repo->getHashPath( $this->file->getName() ); - $this->newHash = $this->file->repo->getHashPath( $this->target->getDBKey() ); + $this->newHash = $this->file->repo->getHashPath( $this->target->getDBkey() ); $this->oldName = $this->file->getName(); $this->newName = $this->file->repo->getNameFromTitle( $this->target ); $this->oldRel = $this->oldHash . $this->oldName; diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index c679dd98cd..2b9fcafda6 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -127,7 +127,7 @@ class LocalRepo extends FSRepo { 'page_id', //Field array( //Conditions 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDBKey(), + 'page_title' => $title->getDBkey(), ), __METHOD__ //Function name ); diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index b1d70bab85..e9d0981dbb 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -175,7 +175,7 @@ class CoreParserFunctions { if( !is_null( $title ) ) { # Convert NS_MEDIA -> NS_FILE if( $title->getNamespace() == NS_MEDIA ) { - $title = Title::makeTitle( NS_FILE, $title->getDBKey() ); + $title = Title::makeTitle( NS_FILE, $title->getDBkey() ); } if( !is_null( $arg ) ) { $text = $title->$func( $arg ); diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 4675fe82bc..b229e932ef 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -125,8 +125,8 @@ class SpecialAllpages extends IncludableSpecialPage { $from = Title::makeTitleSafe( $namespace, $from ); $to = Title::makeTitleSafe( $namespace, $to ); - $from = ( $from && $from->isLocal() ) ? $from->getDBKey() : null; - $to = ( $to && $to->isLocal() ) ? $to->getDBKey() : null; + $from = ( $from && $from->isLocal() ) ? $from->getDBkey() : null; + $to = ( $to && $to->isLocal() ) ? $to->getDBkey() : null; if( isset($from) ) $where[] = 'page_title >= '.$dbr->addQuotes( $from ); diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 58547a23ac..25e07957c0 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -527,7 +527,7 @@ class IPBlockForm { $delAction = LogPage::DELETED_ACTION | Revision::DELETED_RESTRICTED; # Normalize user name $userTitle = Title::makeTitleSafe( NS_USER, $name ); - $userDbKey = $userTitle->getDBKey(); + $userDbKey = $userTitle->getDBkey(); # To suppress, we OR the current bitfields with Revision::DELETED_USER # to put a 1 in the username *_deleted bit. To unsuppress we AND the # current bitfields with the inverse of Revision::DELETED_USER. The diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index 7e500f70c9..8a40e2924b 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -389,7 +389,7 @@ class SpecialExport extends SpecialPage { array_merge( $join, array( 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDBKey() ) ), + 'page_title' => $title->getDBkey() ) ), __METHOD__ ); foreach( $result as $row ) { $template = Title::makeTitle( $row->namespace, $row->title ); diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 5bf205cb78..65d32b8688 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -73,7 +73,7 @@ function wfSpecialFileDuplicateSearch( $par = null ) { if( $title && $title->getText() != '' ) { $dbr = wfGetDB( DB_SLAVE ); $image = $dbr->tableName( 'image' ); - $encFilename = $dbr->addQuotes( htmlspecialchars( $title->getDBKey() ) ); + $encFilename = $dbr->addQuotes( htmlspecialchars( $title->getDBkey() ) ); $sql = "SELECT img_sha1 from $image where img_name = $encFilename"; $res = $dbr->query( $sql ); $row = $dbr->fetchRow( $res ); diff --git a/includes/specials/SpecialListUserRestrictions.php b/includes/specials/SpecialListUserRestrictions.php index eacc810299..4a78f4b416 100644 --- a/includes/specials/SpecialListUserRestrictions.php +++ b/includes/specials/SpecialListUserRestrictions.php @@ -73,7 +73,7 @@ class SpecialListUserRestrictionsForm { $title = Title::newFromText( $page ); if( $title ) { $conds['ur_page_namespace'] = $title->getNamespace(); - $conds['ur_page_title'] = $title->getDBKey(); + $conds['ur_page_title'] = $title->getDBkey(); } return $conds; diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 0c05da0847..26055425e5 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -422,7 +422,7 @@ class MovePageForm { } elseif( $this->moveTalk ) { $conds = array( 'page_namespace' => $ot->getTalkPage()->getNamespace(), - 'page_title' => $ot->getDBKey() + 'page_title' => $ot->getDBkey() ); } else { # Skip the query @@ -450,9 +450,9 @@ class MovePageForm { } $newPageName = preg_replace( - '#^'.preg_quote( $ot->getDBKey(), '#' ).'#', - $nt->getDBKey(), - $oldSubpage->getDBKey() + '#^'.preg_quote( $ot->getDBkey(), '#' ).'#', + $nt->getDBkey(), + $oldSubpage->getDBkey() ); if( $oldSubpage->isTalkPage() ) { $newNs = $nt->getTalkPage()->getNamespace(); diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 87f5e09815..2118f77eb8 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -69,7 +69,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { return $this->tryShowFile( $this->file ); } # Logs must have a type given - if( $this->logids && !strpos($this->page->getDBKey(),'/') ) { + if( $this->logids && !strpos($this->page->getDBkey(),'/') ) { return $wgOut->showErrorPage( 'revdelete-nologtype-title', 'revdelete-nologtype-text' ); } # Give a link to the logs/hist for this page @@ -270,7 +270,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $result = $dbr->select( 'archive', '*', array( 'ar_namespace' => $this->page->getNamespace(), - 'ar_title' => $this->page->getDBKey(), + 'ar_title' => $this->page->getDBkey(), 'ar_timestamp' => $where ), __METHOD__ @@ -372,11 +372,11 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if( $this->deleteKey == 'oldimage' ) { // Run through and pull all our data in one query foreach( $this->ofiles as $timestamp ) { - $where[] = $timestamp.'!'.$this->page->getDBKey(); + $where[] = $timestamp.'!'.$this->page->getDBkey(); } $result = $dbr->select( 'oldimage', '*', array( - 'oi_name' => $this->page->getDBKey(), + 'oi_name' => $this->page->getDBkey(), 'oi_archive_name' => $where ), __METHOD__ @@ -388,7 +388,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { } // Check through our images foreach( $this->ofiles as $timestamp ) { - $archivename = $timestamp.'!'.$this->page->getDBKey(); + $archivename = $timestamp.'!'.$this->page->getDBkey(); if( !isset($filesObjs[$archivename]) ) { continue; } else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) { @@ -411,7 +411,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { } $result = $dbr->select( 'filearchive', '*', array( - 'fa_name' => $this->page->getDBKey(), + 'fa_name' => $this->page->getDBkey(), 'fa_id' => $where ), __METHOD__ @@ -501,7 +501,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { foreach( $this->events as $logid ) { $where[] = intval($logid); } - list($log,$logtype) = explode( '/',$this->page->getDBKey(), 2 ); + list($log,$logtype) = explode( '/',$this->page->getDBkey(), 2 ); $result = $dbr->select( 'logging', '*', array( 'log_type' => $logtype, 'log_id' => $where ), __METHOD__ @@ -960,7 +960,7 @@ class RevisionDeleter { $result = $this->dbw->select( 'archive', '*', array( 'ar_namespace' => $title->getNamespace(), - 'ar_title' => $title->getDBKey(), + 'ar_title' => $title->getDBkey(), 'ar_timestamp' => $where ), __METHOD__ ); @@ -1026,10 +1026,10 @@ class RevisionDeleter { $set = array(); // Run through and pull all our data in one query foreach( $items as $timestamp ) { - $where[] = $timestamp.'!'.$title->getDBKey(); + $where[] = $timestamp.'!'.$title->getDBkey(); } $result = $this->dbw->select( 'oldimage', '*', - array( 'oi_name' => $title->getDBKey(), 'oi_archive_name' => $where ), + array( 'oi_name' => $title->getDBkey(), 'oi_archive_name' => $where ), __METHOD__ ); while( $row = $this->dbw->fetchObject( $result ) ) { @@ -1039,7 +1039,7 @@ class RevisionDeleter { } // To work! foreach( $items as $timestamp ) { - $archivename = $timestamp.'!'.$title->getDBKey(); + $archivename = $timestamp.'!'.$title->getDBkey(); if( !isset($filesObjs[$archivename]) ) { $success = false; continue; // Must exist @@ -1121,7 +1121,7 @@ class RevisionDeleter { $where[] = intval($id); } $result = $this->dbw->select( 'filearchive', '*', - array( 'fa_name' => $title->getDBKey(), + array( 'fa_name' => $title->getDBkey(), 'fa_id' => $where ), __METHOD__ ); while( $row = $this->dbw->fetchObject( $result ) ) { @@ -1175,7 +1175,7 @@ class RevisionDeleter { foreach( $items as $logid ) { $where[] = intval($logid); } - list($log,$logtype) = explode( '/',$title->getDBKey(), 2 ); + list($log,$logtype) = explode( '/',$title->getDBkey(), 2 ); $result = $this->dbw->select( 'logging', '*', array( 'log_type' => $logtype, 'log_id' => $where ), __METHOD__ @@ -1348,7 +1348,7 @@ class RevisionDeleter { $this->dbw->update( 'archive', array( 'ar_deleted' => $bitfield ), array( 'ar_namespace' => $title->getNamespace(), - 'ar_title' => $title->getDBKey(), + 'ar_title' => $title->getDBkey(), // use timestamp for index 'ar_timestamp' => $this->dbw->timestamp( $rev->getTimestamp() ), 'ar_rev_id' => $rev->getId() -- 2.20.1