Needed for mediawiki/extensions/SearchExtraNS
Change-Id: If0a7da5c8691c418bc388e50dd11eea3b57ed45d
$allSearchTerms : Array of the search terms in all content languages
&$titleResult : Outparam; the value to return. A Title object or null.
+'SearchAfterNoDirectMatch': If there was no match for the exact result. This
+runs before lettercase variants are attempted, whereas 'SearchGetNearMatch'
+runs after.
+$term : Search term string
+&$title : Outparam; set to $title object and return false for a match
+
'SearchGetNearMatch': An extra chance for exact-title-matches in "go" searches if nothing was found
$term : Search term string
&$title : Outparam; set to $title object and return false for a match
return $title;
}
+ if ( !wfRunHooks( 'SearchAfterNoDirectMatch', array( $term, &$title ) ) ) {
+ return $title;
+ }
+
# Now try all lower case (i.e. first letter capitalized)
- #
$title = Title::newFromText( $wgContLang->lc( $term ) );
if ( $title && $title->exists() ) {
return $title;
}
# Now try capitalized string
- #
$title = Title::newFromText( $wgContLang->ucwords( $term ) );
if ( $title && $title->exists() ) {
return $title;
}
# Now try all upper case
- #
$title = Title::newFromText( $wgContLang->uc( $term ) );
if ( $title && $title->exists() ) {
return $title;