Revert r61572. These titles are output parameters. A reference is the only way they...
authorPlatonides <platonides@users.mediawiki.org>
Wed, 27 Jan 2010 14:39:03 +0000 (14:39 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 27 Jan 2010 14:39:03 +0000 (14:39 +0000)
(eg. think on a hook that always does 'return $titleResult = Title::newFromText("Foo");').

docs/hooks.txt
includes/search/SearchEngine.php

index 0691bc3..156feb9 100644 (file)
@@ -1289,7 +1289,7 @@ $text : Current text being indexed
 
 'SearchGetNearMatchBefore': Perform exact-title-matches in "go" searches before the normal operations
 $allSearchTerms : Array of the search terms in all content languages
-$titleResult : Outparam; the value to return. A Title object or null.
+&$titleResult : Outparam; the value to return. A Title object or null.
 
 'SearchGetNearMatch': An extra chance for exact-title-matches in "go" searches if nothing was found
 $term : Search term string
@@ -1297,7 +1297,7 @@ $term : Search term string
 
 'SearchGetNearMatchComplete': A chance to modify exact-title-matches in "go" searches
 $term : Search term string
-$title : Current Title object that is being returned (null if none found).
+&$title : Current Title object that is being returned (null if none found).
 
 'SearchEngineReplacePrefixesComplete': Run after SearchEngine::replacePrefixes().
 $searchEngine : The SearchEngine object. Users of this hooks will be interested 
index 6ce20fd..f4ca700 100644 (file)
@@ -77,7 +77,7 @@ class SearchEngine {
        public static function getNearMatch( $searchterm ) {
                $title = self::getNearMatchInternal( $searchterm );
                
-               wfRunHooks( 'SearchGetNearMatchComplete', array( $searchterm, $title ) );
+               wfRunHooks( 'SearchGetNearMatchComplete', array( $searchterm, &$title ) );
                return $title;
        }
        
@@ -93,7 +93,7 @@ class SearchEngine {
                        $allSearchTerms = array_merge($allSearchTerms,$wgContLang->convertLinkToAllVariants($searchterm));
                }
 
-               if( !wfRunHooks( 'SearchGetNearMatchBefore', array( $allSearchTerms, $titleResult ) ) ) {
+               if( !wfRunHooks( 'SearchGetNearMatchBefore', array( $allSearchTerms, &$titleResult ) ) ) {
                        return $titleResult;
                }