From 421a7f1175dda6f75ec4efba44e320c49e94d117 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 5 Jun 2008 18:13:16 +0000 Subject: [PATCH] SpecialSearchResults hook now passes results by reference, so they can be changed by extensions. --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 4 ++-- includes/SpecialSearch.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 898af8c360..4cf6ee4957 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -145,6 +145,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN edits in the last $wgActiveUserDays days. * (bug 13702) Add Special:MissingFiles to list places where an image link is used but no such file exists. +* SpecialSearchResults hook now passes results by reference, so they can be + changed by extensions. === Bug fixes in 1.13 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 3d609903d3..51f52ca7e0 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1091,8 +1091,8 @@ $title: title object generated from the text entred by the user 'SpecialSearchResults': called before search result display when there are matches $term: string of search term -$titleMatches: empty or SearchResultSet object -$textMatches: empty or SearchResultSet object +&$titleMatches: empty or SearchResultSet object +&$textMatches: empty or SearchResultSet object 'SpecialSearchNoResults': called before search result display when there are no matches $term: string of search term diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index d68ff9a8fd..0a483af52f 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -225,7 +225,7 @@ class SpecialSearch { array( 'search' => $term ) ), ($num < $this->limit) ); $wgOut->addHTML( "

{$prevnext}

\n" ); - wfRunHooks( 'SpecialSearchResults', array( $term, $titleMatches, $textMatches ) ); + wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) ); } else { wfRunHooks( 'SpecialSearchNoResults', array( $term ) ); } -- 2.20.1