Revert most of r37534, which was an over-revert: just changing addQuotes() back to...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 10 Jul 2008 21:20:43 +0000 (21:20 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 10 Jul 2008 21:20:43 +0000 (21:20 +0000)
includes/api/ApiQueryCategories.php
includes/api/ApiQueryImages.php
includes/api/ApiQueryLinks.php

index 5e1f983..16a09ec 100644 (file)
@@ -86,7 +86,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                                $this->dieUsage("Invalid continue param. You should pass the " .
                                        "original value returned by the previous query", "_badcontinue");
                        $clfrom = intval($cont[0]);
-                       $clto = $this->getDb()->strencode($cont[1]);
+                       $clto = $this->getDb()->strencode($this->titleToKey($cont[1]));
                        $this->addWhere("cl_from > $clfrom OR ".
                                        "(cl_from = $clfrom AND ".
                                        "cl_to >= '$clto')");
@@ -109,7 +109,8 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                                if (++$count > $params['limit']) {
                                        // We've reached the one extra which shows that
                                        // there are additional pages to be had. Stop here...
-                                       $this->setContinueEnumParameter('continue', "{$row->cl_from}|{$row->cl_to}");
+                                       $this->setContinueEnumParameter('continue', $row->cl_from .
+                                                       '|' . $this->keyToTitle($row->cl_to));
                                        break;
                                }
                                if ($lastId != $row->cl_from) {
@@ -143,7 +144,8 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                                if (++$count > $params['limit']) {
                                        // We've reached the one extra which shows that
                                        // there are additional pages to be had. Stop here...
-                                       $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
+                                       $this->setContinueEnumParameter('continue', $row->cl_from .
+                                                       '|' . $this->keyToTitle($row->cl_to));
                                        break;
                                }
 
index 7aed6eb..35166e0 100644 (file)
@@ -66,7 +66,7 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
                                $this->dieUsage("Invalid continue param. You should pass the " .
                                        "original value returned by the previous query", "_badcontinue");
                        $ilfrom = intval($cont[0]);
-                       $ilto = $this->getDb()->strencode($cont[1]);
+                       $ilto = $this->getDb()->strencode($this->titleToKey($cont[1]));
                        $this->addWhere("il_from > $ilfrom OR ".
                                        "(il_from = $ilfrom AND ".
                                        "il_to >= '$ilto')");
@@ -90,7 +90,8 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
                                if (++$count > $params['limit']) {
                                        // We've reached the one extra which shows that
                                        // there are additional pages to be had. Stop here...
-                                       $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
+                                       $this->setContinueEnumParameter('continue', $row->il_from .
+                                                       '|' . $this->keyToTitle($row->il_to));
                                        break;
                                }
                                if ($lastId != $row->il_from) {
@@ -118,7 +119,8 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
                                if (++$count > $params['limit']) {
                                        // We've reached the one extra which shows that
                                        // there are additional pages to be had. Stop here...
-                                       $this->setContinueEnumParameter('continue', "{$row->il_from}|{$row->il_to}");
+                                       $this->setContinueEnumParameter('continue', $row->il_from .
+                                                       '|' . $this->keyToTitle($row->il_to));
                                        break;
                                }
                                $titles[] = Title :: makeTitle(NS_IMAGE, $row->il_to);
index 0761d91..6bbd893 100644 (file)
@@ -92,7 +92,7 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
                                        "original value returned by the previous query", "_badcontinue");
                        $plfrom = intval($cont[0]);
                        $plns = intval($cont[1]);
-                       $pltitle = $this->getDb()->strencode($cont[2]);
+                       $pltitle = $this->getDb()->strencode($this->titleToKey($cont[2]));
                        $this->addWhere("{$this->prefix}_from > $plfrom OR ".
                                        "({$this->prefix}_from = $plfrom AND ".
                                        "({$this->prefix}_namespace > $plns OR ".
@@ -128,7 +128,8 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
                                        // We've reached the one extra which shows that
                                        // there are additional pages to be had. Stop here...
                                        $this->setContinueEnumParameter('continue',
-                                               "{$row->pl_from}|{$row->pl_namespace}|{$row->pl_title}");
+                                               "{$row->pl_from}|{$row->pl_namespace}|" .
+                                               $this->keyToTitle($row->pl_title));
                                        break;
                                }
                                if ($lastId != $row->pl_from) {
@@ -157,7 +158,8 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
                                        // We've reached the one extra which shows that
                                        // there are additional pages to be had. Stop here...
                                        $this->setContinueEnumParameter('continue',
-                                               "{$row->pl_from}|{$row->pl_namespace}|{$row->pl_title}");
+                                               "{$row->pl_from}|{$row->pl_namespace}|" .
+                                               $this->keyToTitle($row->pl_title));
                                        break;
                                }
                                $titles[] = Title :: makeTitle($row->pl_namespace, $row->pl_title);