From 26e9af5c2717b53df992b379d6b62ca5abe115eb Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sat, 26 Jan 2008 19:27:19 +0000 Subject: [PATCH] Introduce SajaxSearch hook --- includes/AjaxFunctions.php | 7 +++++++ 1 file changed, 7 insertions(+) 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 ) ) ); -- 2.20.1