From 3b7a00358976832d402ee7f5b47fdd1024ddebef Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 5 Sep 2014 06:51:27 -0700 Subject: [PATCH] Reset searchTerms[] before populating. Otherwise, multiple calls to searchQuery() would accumulate search terms. searchTerms[] is defined in SearchEngine so we can't just get rid of it altogether. Change-Id: Iddbb3920e3a9d5849c99fe90d2d725d16019b51d --- includes/search/SearchPostgres.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 914bc1c493..c64c845650 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -142,6 +142,7 @@ class SearchPostgres extends SearchDatabase { $top = $res->fetchRow(); $top = $top[0]; + $this->searchTerms = array(); if ( $top === "" ) { ## e.g. if only stopwords are used XXX return something better $query = "SELECT page_id, page_namespace, page_title, 0 AS score " . "FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id " . -- 2.20.1