From 32042c271f7ce05eb110fd05585b0128076cd16b Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 24 Jan 2009 13:00:43 +0000 Subject: [PATCH] API: (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses. Building query properly now using makeList() --- includes/api/ApiQueryBacklinks.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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)) { -- 2.20.1