From a62f1dc4d812b166a04f2c1890724e57a82a30bb Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 19 Nov 2008 00:19:25 +0000 Subject: [PATCH] * Remove
* Use count variables since they are already there --- includes/specials/SpecialSearch.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 7b5a533490..f15ada498a 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -254,7 +254,7 @@ class SpecialSearch { $wgOut->addHtml( "
" ); if( $titleMatches ) { - if( $titleMatches->numRows() ) { + if( $numTitleMatches > 0 ) { $wgOut->wrapWikiMsg( "==$1==\n", 'titlematches' ); $wgOut->addHTML( $this->showMatches( $titleMatches ) ); } @@ -263,11 +263,9 @@ class SpecialSearch { if( $textMatches ) { // output appropriate heading - if( $textMatches->numRows() ) { - if($titleMatches) - $wgOut->wrapWikiMsg( "==$1==\n", 'textmatches' ); - else // if no title matches the heading is redundant - $wgOut->addHTML("
"); + if( $numTextMatches > 0 && $numTitleMatches > 0 ) { + // if no title matches the heading is redundant + $wgOut->wrapWikiMsg( "==$1==\n", 'textmatches' ); } elseif( $num == 0 ) { # Don't show the 'no text matches' if we received title matches $wgOut->wrapWikiMsg( "==$1==\n", 'notextmatches' ); @@ -276,7 +274,7 @@ class SpecialSearch { if( $textMatches->hasInterwikiResults() ) $wgOut->addHTML( $this->showInterwiki( $textMatches->getInterwikiResults(), $term )); // show results - if( $textMatches->numRows() ) + if( $numTextMatches > 0 ) $wgOut->addHTML( $this->showMatches( $textMatches ) ); $textMatches->free(); -- 2.20.1