Remove mediawiki.special.javaScriptTest module
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 596732d..8809900 100644 (file)
@@ -384,11 +384,10 @@ class SpecialSearch extends SpecialPage {
                                $out->addHTML( $this->showInterwiki( $textMatches->getInterwikiResults(
                                                SearchResultSet::SECONDARY_RESULTS ), $term ) );
                        }
-
-                       $textMatches->free();
                }
 
-               $hasOtherResults = $textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS );
+               $hasOtherResults = $textMatches &&
+                       $textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS );
 
                if ( $num === 0 ) {
                        if ( $textStatus ) {
@@ -415,6 +414,10 @@ class SpecialSearch extends SpecialPage {
                        }
                }
 
+               if ( $textMatches ) {
+                       $textMatches->free();
+               }
+
                $out->addHTML( '<div class="visualClear"></div>' );
 
                if ( $prevnext ) {
@@ -431,6 +434,7 @@ class SpecialSearch extends SpecialPage {
         * Produce wiki header for interwiki results
         * @param string $interwiki Interwiki name
         * @param SearchResultSet $interwikiResult The result set
+        * @return string
         */
        protected function interwikiHeader( $interwiki, $interwikiResult ) {
                // TODO: we need to figure out how to name wikis correctly
@@ -849,6 +853,7 @@ class SpecialSearch extends SpecialPage {
                $html = null;
 
                $score = '';
+               $related = '';
                if ( Hooks::run( 'ShowSearchHit', array(
                        $this, $result, $terms,
                        &$link, &$redirect, &$section, &$extract,