$limit : maximum number of results to return
&$results : out param: array of page names (strings)
+'PrefixSearchExtractNamespace': Called if core was not able to extract a
+namespace from the search string so that extensions can attempt it.
+$namespaces : array of int namespace keys to search in (change this if you can
+extract namespaces)
+$search : search term (replace this with term without the namespace if you can
+extract one)
+
'PrefsEmailAudit': Called when user changes their email address.
$user: User (object) changing his email address
$oldaddr: old email address (string)
$title = Title::newFromText( $search );
if ( $title && !$title->isExternal() ) {
$ns = array( $title->getNamespace() );
+ $search = $title->getText();
if ( $ns[0] == NS_MAIN ) {
$ns = $namespaces; // no explicit prefix, use default namespaces
+ wfRunHooks( 'PrefixSearchExtractNamespace', array( &$ns, &$search ) );
}
- return $this->searchBackend( $ns, $title->getText(), $limit );
+ return $this->searchBackend( $ns, $search, $limit );
}
// Is this a namespace prefix?
{
$namespaces = array( $title->getNamespace() );
$search = '';
+ } else {
+ wfRunHooks( 'PrefixSearchExtractNamespace', array( &$namespaces, &$search ) );
}
return $this->searchBackend( $namespaces, $search, $limit );