r78320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78319‎ | r78320 | r78321 >
Date:20:00, 13 December 2010
Author:btongminh
Status:ok
Tags:
Comment:
Follow-up r78297: allow the hook to break the execution; added &$term: could be useful for modifying the edit link
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1609,6 +1609,7 @@
16101610
16111611 'SpecialSearchGo': called when user clicked the "Go"
16121612 &$title: title object generated from the text entered by the user
 1613+&$term: the search term entered by the user
16131614
16141615 'SpecialSearchNogomatch': called when user clicked the "Go" button but the
16151616 target doesn't exist
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -102,7 +102,12 @@
103103 }
104104 # If there's an exact or very near match, jump right there.
105105 $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+
107112 if( !is_null( $t ) ) {
108113 $wgOut->redirect( $t->getFullURL() );
109114 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r78323MFT SpecialSearchGo hook: r78320, r78268, r78295, r78297, r78320btongminh20:12, 13 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78297Followup r78295, seems I didn't even bother to rename it last timereedy12:38, 13 December 2010

Status & tagging log