r37534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37533‎ | r37534 | r37535 >
Date:21:08, 10 July 2008
Author:brion
Status:old
Tags:
Comment:
Partial revert of r37502, 37503: double-quoting of SQL strings
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryCategories.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLangLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLinks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryLinks.php
@@ -92,7 +92,7 @@
9393 "original value returned by the previous query", "_badcontinue");
9494 $plfrom = intval($cont[0]);
9595 $plns = intval($cont[1]);
96 - $pltitle = $this->getDb()->addQuotes($this->titleToKey($cont[2]));
 96+ $pltitle = $this->getDb()->strencode($cont[2]);
9797 $this->addWhere("{$this->prefix}_from > $plfrom OR ".
9898 "({$this->prefix}_from = $plfrom AND ".
9999 "({$this->prefix}_namespace > $plns OR ".
@@ -128,8 +128,7 @@
129129 // We've reached the one extra which shows that
130130 // there are additional pages to be had. Stop here...
131131 $this->setContinueEnumParameter('continue',
132 - "{$row->pl_from}|{$row->pl_namespace}|" .
133 - $this->keyToTitle($row->pl_title));
 132+ "{$row->pl_from}|{$row->pl_namespace}|{$row->pl_title}");
134133 break;
135134 }
136135 if ($lastId != $row->pl_from) {
@@ -158,8 +157,7 @@
159158 // We've reached the one extra which shows that
160159 // there are additional pages to be had. Stop here...
161160 $this->setContinueEnumParameter('continue',
162 - "{$row->pl_from}|{$row->pl_namespace}|" .
163 - $this->keyToTitle($row->pl_title));
 161+ "{$row->pl_from}|{$row->pl_namespace}|{$row->pl_title}");
164162 break;
165163 }
166164 $titles[] = Title :: makeTitle($row->pl_namespace, $row->pl_title);
Index: trunk/phase3/includes/api/ApiQueryLangLinks.php
@@ -58,7 +58,7 @@
5959 $this->dieUsage("Invalid continue param. You should pass the " .
6060 "original value returned by the previous query", "_badcontinue");
6161 $llfrom = intval($cont[0]);
62 - $lllang = $this->getDb()->addQuotes($cont[1]);
 62+ $lllang = $this->getDb()->strencode($cont[1]);
6363 $this->addWhere("ll_from > $llfrom OR ".
6464 "(ll_from = $llfrom AND ".
6565 "ll_lang >= '$lllang')");
Index: trunk/phase3/includes/api/ApiQueryCategories.php
@@ -86,7 +86,7 @@
8787 $this->dieUsage("Invalid continue param. You should pass the " .
8888 "original value returned by the previous query", "_badcontinue");
8989 $clfrom = intval($cont[0]);
90 - $clto = $this->getDb()->addQuotes($this->titleToKey($cont[1]));
 90+ $clto = $this->getDb()->strencode($cont[1]);
9191 $this->addWhere("cl_from > $clfrom OR ".
9292 "(cl_from = $clfrom AND ".
9393 "cl_to >= '$clto')");
@@ -109,8 +109,7 @@
110110 if (++$count > $params['limit']) {
111111 // We've reached the one extra which shows that
112112 // there are additional pages to be had. Stop here...
113 - $this->setContinueEnumParameter('continue', $row->cl_from .
114 - '|' . $this->keyToTitle($row->cl_to));
 113+ $this->setContinueEnumParameter('continue', "{$row->cl_from}|{$row->cl_to}");
115114 break;
116115 }
117116 if ($lastId != $row->cl_from) {
@@ -144,8 +143,7 @@
145144 if (++$count > $params['limit']) {
146145 // We've reached the one extra which shows that
147146 // there are additional pages to be had. Stop here...
148 - $this->setContinueEnumParameter('continue', $row->cl_from .
149 - '|' . $this->keyToTitle($row->cl_to));
 147+ $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
150148 break;
151149 }
152150
Index: trunk/phase3/includes/api/ApiQueryImages.php
@@ -66,7 +66,7 @@
6767 $this->dieUsage("Invalid continue param. You should pass the " .
6868 "original value returned by the previous query", "_badcontinue");
6969 $ilfrom = intval($cont[0]);
70 - $ilto = $this->getDb()->addQuotes($this->titleToKey($cont[1]));
 70+ $ilto = $this->getDb()->strencode($cont[1]);
7171 $this->addWhere("il_from > $ilfrom OR ".
7272 "(il_from = $ilfrom AND ".
7373 "il_to >= '$ilto')");
@@ -90,8 +90,7 @@
9191 if (++$count > $params['limit']) {
9292 // We've reached the one extra which shows that
9393 // there are additional pages to be had. Stop here...
94 - $this->setContinueEnumParameter('continue', $row->il_from .
95 - '|' . $this->keyToTitle($row->il_to));
 94+ $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
9695 break;
9796 }
9897 if ($lastId != $row->il_from) {
@@ -119,8 +118,7 @@
120119 if (++$count > $params['limit']) {
121120 // We've reached the one extra which shows that
122121 // there are additional pages to be had. Stop here...
123 - $this->setContinueEnumParameter('continue', $row->il_from .
124 - '|' . $this->keyToTitle($row->il_to));
 122+ $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
125123 break;
126124 }
127125 $titles[] = Title :: makeTitle(NS_IMAGE, $row->il_to);

Follow-up revisions

RevisionCommit summaryAuthorDate
r37535Revert most of r37534, which was an over-revert: just changing addQuotes() ba...catrope21:20, 10 July 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37502API: Some cleanup and fixes before 1.13 is released:...catrope14:13, 10 July 2008

Status & tagging log