Just do a selectRow(). We're only returning 1 row anyway.
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 18 Feb 2009 19:37:23 +0000 (19:37 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 18 Feb 2009 19:37:23 +0000 (19:37 +0000)
includes/Article.php

index eeaca04..2a9f66d 100644 (file)
@@ -84,12 +84,12 @@ class Article {
                        return $this->mRedirectTarget;
                # Query the redirect table
                $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'redirect',
+               $row = $dbr->selectRow( 'redirect',
                        array('rd_namespace', 'rd_title'),
-                       array('rd_from' => $this->getID()),
+                       array('rd_from' => $this->getID() ),
                        __METHOD__
                );
-               if( $row = $dbr->fetchObject($res) ) {
+               if( $row ) {
                        return $this->mRedirectTarget = Title::makeTitle($row->rd_namespace, $row->rd_title);
                }
                # This page doesn't have an entry in the redirect table