r37535 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37534‎ | r37535 | r37536 >
Date:21:20, 10 July 2008
Author:catrope
Status:old
Tags:
Comment:
Revert most of r37534, which was an over-revert: just changing addQuotes() back to strencode() was enough.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryCategories.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImages.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()->strencode($cont[2]);
 96+ $pltitle = $this->getDb()->strencode($this->titleToKey($cont[2]));
9797 $this->addWhere("{$this->prefix}_from > $plfrom OR ".
9898 "({$this->prefix}_from = $plfrom AND ".
9999 "({$this->prefix}_namespace > $plns OR ".
@@ -128,7 +128,8 @@
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}|{$row->pl_title}");
 132+ "{$row->pl_from}|{$row->pl_namespace}|" .
 133+ $this->keyToTitle($row->pl_title));
133134 break;
134135 }
135136 if ($lastId != $row->pl_from) {
@@ -157,7 +158,8 @@
158159 // We've reached the one extra which shows that
159160 // there are additional pages to be had. Stop here...
160161 $this->setContinueEnumParameter('continue',
161 - "{$row->pl_from}|{$row->pl_namespace}|{$row->pl_title}");
 162+ "{$row->pl_from}|{$row->pl_namespace}|" .
 163+ $this->keyToTitle($row->pl_title));
162164 break;
163165 }
164166 $titles[] = Title :: makeTitle($row->pl_namespace, $row->pl_title);
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()->strencode($cont[1]);
 90+ $clto = $this->getDb()->strencode($this->titleToKey($cont[1]));
9191 $this->addWhere("cl_from > $clfrom OR ".
9292 "(cl_from = $clfrom AND ".
9393 "cl_to >= '$clto')");
@@ -109,7 +109,8 @@
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}|{$row->cl_to}");
 113+ $this->setContinueEnumParameter('continue', $row->cl_from .
 114+ '|' . $this->keyToTitle($row->cl_to));
114115 break;
115116 }
116117 if ($lastId != $row->cl_from) {
@@ -143,7 +144,8 @@
144145 if (++$count > $params['limit']) {
145146 // We've reached the one extra which shows that
146147 // there are additional pages to be had. Stop here...
147 - $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
 148+ $this->setContinueEnumParameter('continue', $row->cl_from .
 149+ '|' . $this->keyToTitle($row->cl_to));
148150 break;
149151 }
150152
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()->strencode($cont[1]);
 70+ $ilto = $this->getDb()->strencode($this->titleToKey($cont[1]));
7171 $this->addWhere("il_from > $ilfrom OR ".
7272 "(il_from = $ilfrom AND ".
7373 "il_to >= '$ilto')");
@@ -90,7 +90,8 @@
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}|{$row->il_to}");
 94+ $this->setContinueEnumParameter('continue', $row->il_from .
 95+ '|' . $this->keyToTitle($row->il_to));
9596 break;
9697 }
9798 if ($lastId != $row->il_from) {
@@ -118,7 +119,8 @@
119120 if (++$count > $params['limit']) {
120121 // We've reached the one extra which shows that
121122 // there are additional pages to be had. Stop here...
122 - $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
 123+ $this->setContinueEnumParameter('continue', $row->il_from .
 124+ '|' . $this->keyToTitle($row->il_to));
123125 break;
124126 }
125127 $titles[] = Title :: makeTitle(NS_IMAGE, $row->il_to);

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37534Partial revert of r37502, 37503: double-quoting of SQL stringsbrion21:08, 10 July 2008

Status & tagging log