r93394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93393‎ | r93394 | r93395 >
Date:15:42, 28 July 2011
Author:ashley
Status:deferred
Tags:
Comment:
SemanticForms: in SF_Utils.php, tweak the Database usage in getCategoriesForPage() -- you don't need to call tableName() here and using an array for the WHERE clause is a bit clearer (although $titlekey is guaranteed to be an integer)
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -129,10 +129,14 @@
130130 // Something's wrong - exit
131131 return $categories;
132132 }
133 - $conditions = "cl_from='$titlekey'";
 133+ $conditions['cl_from'] = $titlekey;
134134 }
135 - $res = $db->select( $db->tableName( 'categorylinks' ),
136 - 'distinct cl_to', $conditions, __METHOD__ );
 135+ $res = $db->select(
 136+ 'categorylinks',
 137+ 'DISTINCT cl_to',
 138+ $conditions,
 139+ __METHOD__
 140+ );
137141 if ( $db->numRows( $res ) > 0 ) {
138142 while ( $row = $db->fetchRow( $res ) ) {
139143 $categories[] = $row[0];