r47463 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47462‎ | r47463 | r47464 >
Date:19:37, 18 February 2009
Author:demon
Status:ok
Tags:
Comment:
Just do a selectRow(). We're only returning 1 row anyway.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -84,12 +84,12 @@
8585 return $this->mRedirectTarget;
8686 # Query the redirect table
8787 $dbr = wfGetDB( DB_SLAVE );
88 - $res = $dbr->select( 'redirect',
 88+ $row = $dbr->selectRow( 'redirect',
8989 array('rd_namespace', 'rd_title'),
90 - array('rd_from' => $this->getID()),
 90+ array('rd_from' => $this->getID() ),
9191 __METHOD__
9292 );
93 - if( $row = $dbr->fetchObject($res) ) {
 93+ if( $row ) {
9494 return $this->mRedirectTarget = Title::makeTitle($row->rd_namespace, $row->rd_title);
9595 }
9696 # This page doesn't have an entry in the redirect table

Status & tagging log