Revision: 46134
Author:   catrope
Date:     2009-01-24 13:00:43 +0000 (Sat, 24 Jan 2009)

Log Message:
-----------
API: (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing 
parentheses. Building query properly now using makeList()

Modified Paths:
--------------
    trunk/phase3/includes/api/ApiQueryBacklinks.php

Modified: trunk/phase3/includes/api/ApiQueryBacklinks.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryBacklinks.php     2009-01-24 13:00:34 UTC 
(rev 46133)
+++ trunk/phase3/includes/api/ApiQueryBacklinks.php     2009-01-24 13:00:43 UTC 
(rev 46134)
@@ -137,13 +137,11 @@
                $this->addFields($this->bl_title);
                if($this->hasNS)
                        $this->addFields($this->bl_ns);
-               $titleWhere = '';
+               $titleWhere = array();
                foreach($this->redirTitles as $t)
-                       $titleWhere .= ($titleWhere != '' ? " OR " : '') .
-                                       "({$this->bl_title} = 
".$db->addQuotes($t->getDBKey()).
-                                       ($this->hasNS ? " AND {$this->bl_ns} = 
'{$t->getNamespace()}'" : "") .
-                                       ")";
-               $this->addWhere($titleWhere);
+                       $titleWhere[] = "{$this->bl_title} = 
".$db->addQuotes($t->getDBKey()).
+                                       ($this->hasNS ? " AND {$this->bl_ns} = 
'{$t->getNamespace()}'" : "");
+               $this->addWhere($db->makeList($titleWhere, LIST_OR));
                $this->addWhereFld('page_namespace', 
$this->params['namespace']);
                if(!is_null($this->redirID))
                {



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to