From: Victor Vasiliev Date: Sat, 26 Jan 2008 19:27:19 +0000 (+0000) Subject: Introduce SajaxSearch hook X-Git-Tag: 1.31.0-rc.0~49765 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=26e9af5c2717b53df992b379d6b62ca5abe115eb;p=lhc%2Fweb%2Fwiklou.git Introduce SajaxSearch hook --- diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php index 9704e83a24..50182d8aac 100644 --- a/includes/AjaxFunctions.php +++ b/includes/AjaxFunctions.php @@ -79,6 +79,13 @@ function wfSajaxSearch( $term ) { global $wgContLang, $wgOut, $wgUser, $wgCapitalLinks, $wgMemc; $limit = 16; $sk = $wgUser->getSkin(); + $output = ''; + + if( !wfRunHooks( 'SajaxSearch', array( $term, &$output ) ) ) { + $response = new AjaxResponse( $output ); + $response->setCacheDuration( 30*60 ); + return $response; + } $term = trim( $term ); $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) );