From: Aaron Schulz Date: Wed, 9 Apr 2008 12:15:44 +0000 (+0000) Subject: Partial revert of r32982; old Title method is fine here X-Git-Tag: 1.31.0-rc.0~48492 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=8c719c68b1fda9cda3ba5f5af025fa44a78f143b;p=lhc%2Fweb%2Fwiklou.git Partial revert of r32982; old Title method is fine here --- diff --git a/includes/LinkBatch.php b/includes/LinkBatch.php index 51263b5f2e..746092e6a3 100644 --- a/includes/LinkBatch.php +++ b/includes/LinkBatch.php @@ -96,7 +96,7 @@ class LinkBatch { $ids = array(); $remaining = $this->data; while ( $row = $res->fetchObject() ) { - $title = Title::newFromRow( $row ); + $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $cache->addGoodLinkObj( $row->page_id, $title, $row->page_len, $row->page_is_redirect ); $ids[$title->getPrefixedDBkey()] = $row->page_id; unset( $remaining[$row->page_namespace][$row->page_title] ); diff --git a/includes/Parser.php b/includes/Parser.php index 3e8c9e4248..8de72b88d9 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4026,7 +4026,7 @@ class Parser # Fetch data and form into an associative array # non-existent = broken while ( $s = $dbr->fetchObject($res) ) { - $title = Title::newFromRow( $s ); + $title = Title::makeTitle( $s->page_namespace, $s->page_title ); $pdbk = $title->getPrefixedDBkey(); $linkCache->addGoodLinkObj( $s->page_id, $title, $s->page_len, $s->page_is_redirect ); $this->mOutput->addLink( $title, $s->page_id ); @@ -4103,7 +4103,7 @@ class Parser // for each found variants, figure out link holders and replace while ( $s = $dbr->fetchObject($varRes) ) { - $variantTitle = Title::newFromRow( $s ); + $variantTitle = Title::makeTitle( $s->page_namespace, $s->page_title ); $varPdbk = $variantTitle->getPrefixedDBkey(); $vardbk = $variantTitle->getDBkey(); diff --git a/includes/Parser_OldPP.php b/includes/Parser_OldPP.php index 852f338646..0f35bab341 100644 --- a/includes/Parser_OldPP.php +++ b/includes/Parser_OldPP.php @@ -4145,7 +4145,7 @@ class Parser_OldPP # 1 = known # 2 = stub while ( $s = $dbr->fetchObject($res) ) { - $title = Title::newFromRow( $s ); + $title = Title::makeTitle( $s->page_namespace, $s->page_title ); $pdbk = $title->getPrefixedDBkey(); $linkCache->addGoodLinkObj( $s->page_id, $title, $s->page_len, $s->page_is_redirect ); $this->mOutput->addLink( $title, $s->page_id ); @@ -4223,7 +4223,7 @@ class Parser_OldPP // for each found variants, figure out link holders and replace while ( $s = $dbr->fetchObject($varRes) ) { - $variantTitle = Title::newFromRow( $s ); + $variantTitle = Title::makeTitle( $s->page_namespace, $s->page_title ); $varPdbk = $variantTitle->getPrefixedDBkey(); $vardbk = $variantTitle->getDBkey(); diff --git a/includes/WatchlistEditor.php b/includes/WatchlistEditor.php index 984873496b..90c12c406b 100644 --- a/includes/WatchlistEditor.php +++ b/includes/WatchlistEditor.php @@ -205,15 +205,14 @@ class WatchlistEditor { $dbr = wfGetDB( DB_MASTER ); $uid = intval( $user->getId() ); list( $watchlist, $page ) = $dbr->tableNamesN( 'watchlist', 'page' ); - $sql = "SELECT wl_namespace, wl_title, page_id, page_len, page_is_redirect, - page_namespace, page_title + $sql = "SELECT wl_namespace, wl_title, page_id, page_len, page_is_redirect FROM {$watchlist} LEFT JOIN {$page} ON ( wl_namespace = page_namespace AND wl_title = page_title ) WHERE wl_user = {$uid}"; $res = $dbr->query( $sql, __METHOD__ ); if( $res && $dbr->numRows( $res ) > 0 ) { $cache = LinkCache::singleton(); while( $row = $dbr->fetchObject( $res ) ) { - $title = Title::newFromRow( $row ); + $title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title ); if( $title instanceof Title ) { // Update the link cache while we're at it if( $row->page_id ) {