From: Roan Kattouw Date: Sat, 24 Jan 2009 13:00:43 +0000 (+0000) Subject: API: (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses... X-Git-Tag: 1.31.0-rc.0~43280 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=32042c271f7ce05eb110fd05585b0128076cd16b;p=lhc%2Fweb%2Fwiklou.git API: (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses. Building query properly now using makeList() --- diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 83f8c5b0ec..6514a7ed7c 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -137,13 +137,11 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $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)) {