* Re-applying r34449, r34500 and r34518 which Brion reverted by accident
[lhc/web/wiklou.git] / includes / api / ApiQueryBacklinks.php
index 6e0a588..8081837 100644 (file)
@@ -96,12 +96,12 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
 
        private function prepareFirstQuery($resultPageSet = null) {
                /* SELECT page_id, page_title, page_namespace, page_is_redirect
-                * FROM pagelinks JOIN page ON pl_from=page_id
-                * WHERE pl_title='Foo' AND pl_namespace=0
+                * FROM pagelinks, page WHERE pl_from=page_id
+                * AND pl_title='Foo' AND pl_namespace=0
                 * LIMIT 11 ORDER BY pl_from
                 */
                $db = $this->getDb();
-               $this->addTables(array($this->bl_table, 'page'));
+               $this->addTables(array('page', $this->bl_table));
                $this->addWhere("{$this->bl_from}=page_id");
                if(is_null($resultPageSet))
                        $this->addFields(array('page_id', 'page_title', 'page_namespace'));
@@ -124,12 +124,12 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
 
        private function prepareSecondQuery($resultPageSet = null) {
                /* SELECT page_id, page_title, page_namespace, page_is_redirect, pl_title, pl_namespace
-                * FROM pagelinks JOIN page ON pl_from=page_id
-                * WHERE (pl_title='Foo' AND pl_namespace=0) OR (pl_title='Bar' AND pl_namespace=1)
+                * FROM pagelinks, page WHERE pl_from=page_id
+                * AND (pl_title='Foo' AND pl_namespace=0) OR (pl_title='Bar' AND pl_namespace=1)
                 * LIMIT 11 ORDER BY pl_namespace, pl_title, pl_from
                 */
                $db = $this->getDb();
-               $this->addTables(array($this->bl_table, 'page'));
+               $this->addTables(array('page', $this->bl_table));
                $this->addWhere("{$this->bl_from}=page_id");
                if(is_null($resultPageSet))
                        $this->addFields(array('page_id', 'page_title', 'page_namespace', 'page_is_redirect'));
@@ -267,7 +267,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                        if (!is_null($title)) {
                                $this->rootTitle = Title :: newFromText($title);
                        } else {
-                               $this->dieUsageMsg(array('missingparam', "title"));
+                               $this->dieUsageMsg(array('missingparam', 'title'));
                        }
                }