Proper casing for getDBkey()
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 24 May 2009 08:29:10 +0000 (08:29 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 24 May 2009 08:29:10 +0000 (08:29 +0000)
17 files changed:
includes/Article.php
includes/Category.php
includes/LogPage.php
includes/Title.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryCategoryInfo.php
includes/api/ApiQueryInfo.php
includes/filerepo/LocalFile.php
includes/filerepo/LocalRepo.php
includes/parser/CoreParserFunctions.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlockip.php
includes/specials/SpecialExport.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialListUserRestrictions.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialRevisiondelete.php

index cbd3cfe..033ecfc 100644 (file)
@@ -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 ),
index 50efdbc..611d087 100644 (file)
@@ -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;
index 82ff8e2..762e775 100644 (file)
@@ -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 ) ).')';
index f4c4641..084ae71 100644 (file)
@@ -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:
index b18986a..4f23d6e 100644 (file)
@@ -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)
index 9e36d93..82e431a 100644 (file)
@@ -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'));
index 17c693e..fab5ca2 100644 (file)
@@ -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;
 
index d1ef4e2..d87e7bb 100644 (file)
@@ -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;
index c679dd9..2b9fcaf 100644 (file)
@@ -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
                );
index b1d70ba..e9d0981 100644 (file)
@@ -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 );
index 4675fe8..b229e93 100644 (file)
@@ -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 );
index 58547a2..25e0795 100644 (file)
@@ -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
index 7e500f7..8a40e29 100644 (file)
@@ -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 );
index 5bf205c..65d32b8 100644 (file)
@@ -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 );
index eacc810..4a78f4b 100644 (file)
@@ -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;
index 0c05da0..2605542 100644 (file)
@@ -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();
index 87f5e09..2118f77 100644 (file)
@@ -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()