r25473 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25472‎ | r25473 | r25474 >
Date:14:25, 4 September 2007
Author:brion
Status:old
Tags:
Comment:
Use 'enc' variable naming convention for interpolated pre-encoded variables in raw SQL strings. This'll keep your release manager from freaking out when he sees raw variables being dumped into raw SQL.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryCategoryMembers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
@@ -152,13 +152,14 @@
153153 if ($hasError)
154154 $this->dieUsage("Invalid continue param. You should pass the original value returned by the previous query", "badcontinue");
155155
156 - $sortKey = $this->getDB()->addQuotes($continueList[0]);
 156+ $encSortKey = $this->getDB()->addQuotes($continueList[0]);
 157+ $encFrom = $this->getDB()->addQuotes($from);
157158
158159 if ($from != 0) {
159160 // Duplicate sort key continue
160 - $this->addWhere( "cl_sortkey>$sortKey OR (cl_sortkey=$sortKey AND cl_from>=$from)" );
 161+ $this->addWhere( "cl_sortkey>$encSortKey OR (cl_sortkey=$encSortKey AND cl_from>=$encFrom)" );
161162 } else {
162 - $this->addWhere( "cl_sortkey>=$sortKey" );
 163+ $this->addWhere( "cl_sortkey>=$encSortKey" );
163164 }
164165 }
165166

Follow-up revisions

RevisionCommit summaryAuthorDate
r25530Merged revisions 25454-25529 via svnmerge from...david08:28, 5 September 2007

Status & tagging log