Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1609,6 +1609,7 @@ |
1610 | 1610 | |
1611 | 1611 | 'SpecialSearchGo': called when user clicked the "Go" |
1612 | 1612 | &$title: title object generated from the text entered by the user |
| 1613 | +&$term: the search term entered by the user |
1613 | 1614 | |
1614 | 1615 | 'SpecialSearchNogomatch': called when user clicked the "Go" button but the |
1615 | 1616 | target doesn't exist |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -102,7 +102,12 @@ |
103 | 103 | } |
104 | 104 | # If there's an exact or very near match, jump right there. |
105 | 105 | $t = SearchEngine::getNearMatch( $term ); |
106 | | - wfRunHooks( 'SpecialSearchGo', array( &$t ) ); |
| 106 | + |
| 107 | + if ( !wfRunHooks( 'SpecialSearchGo', array( &$t, &$term ) ) ) { |
| 108 | + # Hook requested termination |
| 109 | + return; |
| 110 | + } |
| 111 | + |
107 | 112 | if( !is_null( $t ) ) { |
108 | 113 | $wgOut->redirect( $t->getFullURL() ); |
109 | 114 | return; |