dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Improve documentation for "pipe trick""
[lhc/web/wiklou.git]
/
includes
/
search
/
SearchEngine.php
diff --git
a/includes/search/SearchEngine.php
b/includes/search/SearchEngine.php
index
ec542a6
..
0199edb
100644
(file)
--- a/
includes/search/SearchEngine.php
+++ b/
includes/search/SearchEngine.php
@@
-187,6
+187,11
@@
class SearchEngine {
return null;
}
return null;
}
+ # Try files if searching in the Media: namespace
+ if ( $title->getNamespace() == NS_MEDIA ) {
+ $title = Title::makeTitle( NS_FILE, $title->getText() );
+ }
+
if ( $title->isSpecialPage() || $title->isExternal() || $title->exists() ) {
return $title;
}
if ( $title->isSpecialPage() || $title->isExternal() || $title->exists() ) {
return $title;
}
@@
-197,22
+202,23
@@
class SearchEngine {
return $title;
}
return $title;
}
+ if ( !wfRunHooks( 'SearchAfterNoDirectMatch', array( $term, &$title ) ) ) {
+ return $title;
+ }
+
# Now try all lower case (i.e. first letter capitalized)
# 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->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->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;
$title = Title::newFromText( $wgContLang->uc( $term ) );
if ( $title && $title->exists() ) {
return $title;