From b84ab27da3e09b1569f68cd6be960b17564cd126 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 24 Nov 2003 14:47:05 +0000 Subject: [PATCH] Don't run the query if search is disabled! --- includes/SearchEngine.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 7253e6edcf..cca48df612 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -172,17 +172,17 @@ class SearchEngine { $searchnamespaces = $this->queryNamespaces(); $redircond = $this->searchRedirects(); - $sql = "SELECT cur_id,cur_namespace,cur_title," . - "cur_text FROM cur,searchindex " . - "WHERE cur_id=si_page AND {$this->mTitlecond} " . - "{$searchnamespaces} {$redircond}" . - "LIMIT {$offset}, {$limit}"; - $res1 = wfQuery( $sql, DB_READ, $fname ); - $num = wfNumRows($res1); - if ( $wgDisableTextSearch ) { $wgOut->addHTML( wfMsg( "searchdisabled", htmlspecialchars( $search ), $wgInputEncoding ) ); } else { + $sql = "SELECT cur_id,cur_namespace,cur_title," . + "cur_text FROM cur,searchindex " . + "WHERE cur_id=si_page AND {$this->mTitlecond} " . + "{$searchnamespaces} {$redircond}" . + "LIMIT {$offset}, {$limit}"; + $res1 = wfQuery( $sql, DB_READ, $fname ); + $num = wfNumRows($res1); + $sk = $wgUser->getSkin(); $text = wfMsg( "searchresulttext", $sk->makeKnownLink( wfMsg( "searchhelppage" ), wfMsg( "searchingwikipedia" ) ) ); -- 2.20.1