Fix hooks.txt SpecialSearchNogomatch $title to &$title
authorSam Reed <reedy@users.mediawiki.org>
Fri, 16 Apr 2010 10:19:50 +0000 (10:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 16 Apr 2010 10:19:50 +0000 (10:19 +0000)
* (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
RELEASE-NOTES
docs/hooks.txt
includes/specials/SpecialSearch.php

diff --git a/CREDITS b/CREDITS
index f256c36..1d0b409 100644 (file)
--- 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
index 2863ea0..915b17c 100644 (file)
@@ -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
index 82248a7..e3be921 100644 (file)
@@ -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.
index da054e0..06d74f2 100644 (file)
@@ -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