From 505f4ce94a7d8625cb001b9b6b5cb2601f7e8301 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 16 Apr 2010 10:19:50 +0000 Subject: [PATCH] Fix hooks.txt SpecialSearchNogomatch $title to &$title * (bug 23206) Add Special::Search hook for detecting successful "Go" Not implemented completely as per patch, $term removed, seems a bit useless/redundant (and doesn't exist for Nomatch) --- CREDITS | 1 + RELEASE-NOTES | 1 + docs/hooks.txt | 6 +++++- includes/specials/SpecialSearch.php | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CREDITS b/CREDITS index f256c369db..1d0b4091af 100644 --- a/CREDITS +++ b/CREDITS @@ -75,6 +75,7 @@ following names for their contribution to the product. * Brianna Laugher * Carlin * Conrad Irwin +* Dan Barrett * Dan Nessett * Daniel Arnold * Denny Vrandecic diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2863ea0237..915b17cc18 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -47,6 +47,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN escaping. * Special:Listfiles now supports a username parameter * Special:Random carries over query string parameters +* (bug 23206) Add Special::Search hook for detecting successful "Go" === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/docs/hooks.txt b/docs/hooks.txt index 82248a7211..e3be9214cb 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1498,9 +1498,13 @@ SpecialRecentChanges $opts: FormOptions for this request &$query_options: array of options for the database request +'SpecialSearchGomatch': called when user clicked the "Go" button and the target +exists +&$title: title object generated from the text entred by the user + 'SpecialSearchNogomatch': called when user clicked the "Go" button but the target doesn't exist -$title: title object generated from the text entred by the user +&$title: title object generated from the text entred by the user 'SpecialSearchProfiles': allows modification of search profiles &$profiles: profiles, which can be modified. diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index da054e02bd..06d74f2566 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -92,6 +92,7 @@ class SpecialSearch { # If there's an exact or very near match, jump right there. $t = SearchEngine::getNearMatch( $term ); if( !is_null( $t ) ) { + wfRunHooks( 'SpecialSearchGomatch', array( &$t ) ); $wgOut->redirect( $t->getFullURL() ); return; } @@ -881,7 +882,6 @@ class SpecialSearch { $bareterm = substr( $term, strpos( $term, ':' ) + 1 ); } - $profiles = $this->getSearchProfiles(); // Outputs XML for Search Types -- 2.20.1