r104683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104682‎ | r104683 | r104684 >
Date:14:48, 30 November 2011
Author:cervidae
Status:ok (Comments)
Tags:
Comment:
select instead of query
Modified paths:
  • /trunk/extensions/HelpCommons/HelpCommons.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HelpCommons/HelpCommons.php
@@ -57,7 +57,12 @@
5858 foreach ( $urls as $helpwiki ) {
5959 if ( $wgLanguageCode == "$language" && $wgDBname != $helpwiki ) {
6060 $dbr = wfGetDB( DB_SLAVE, array(), $helpwiki );
61 - $page = $dbr->query( 'SELECT page_title, page_namespace, page_latest FROM page WHERE page_namespace = 12 AND page_title = '.$dbr->addQuotes($title) );
 61+ $page = $dbr->select(
 62+ 'page',
 63+ array( 'page_title', 'page_namespace', 'page_latest' ),
 64+ array( 'page_namespace' => 12, 'page_title' => $title ),
 65+ __METHOD__
 66+ );
6267 $page = $dbr->fetchObject( $page );
6368 }
6469 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r104965get namespace ids from NS_ constantscervidae13:20, 2 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104444Merging with Reedy's several code changes. Thankscervidae15:37, 28 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   08:25, 2 December 2011

Still could benefit from those NS_FOO constants.

#Comment by SVG (talk | contribs)   13:21, 2 December 2011

Thanks. Fixed in r104965.

Status & tagging log