summaryrefslogtreecommitdiff
path: root/includes/PrefixSearch.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
committerPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
commitb9b85843572bf283f48285001e276ba7e61b63f6 (patch)
tree4c6f4571552ada9ccfb4030481dcf77308f8b254 /includes/PrefixSearch.php
parentd9a20acc4e789cca747ad360d87ee3f3e7aa58c1 (diff)
updated to MediaWiki 1.14.0
Diffstat (limited to 'includes/PrefixSearch.php')
-rw-r--r--includes/PrefixSearch.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/includes/PrefixSearch.php b/includes/PrefixSearch.php
index a3ff05e2..af569112 100644
--- a/includes/PrefixSearch.php
+++ b/includes/PrefixSearch.php
@@ -1,5 +1,12 @@
<?php
+/**
+ * PrefixSearch - Handles searching prefixes of titles and finding any page
+ * names that match. Used largely by the OpenSearch implementation.
+ *
+ * @ingroup Search
+ */
+
class PrefixSearch {
/**
* Do a prefix search of titles and return a list of matching page names.
@@ -48,7 +55,7 @@ class PrefixSearch {
if( count($namespaces) == 1 ){
$ns = $namespaces[0];
if( $ns == NS_MEDIA ) {
- $namespaces = array(NS_IMAGE);
+ $namespaces = array(NS_FILE);
} elseif( $ns == NS_SPECIAL ) {
return self::specialSearch( $search, $limit );
}
@@ -96,7 +103,9 @@ class PrefixSearch {
/**
* Unless overridden by PrefixSearchBackend hook...
- * This is case-sensitive except the first letter (per $wgCapitalLinks)
+ * This is case-sensitive (First character may
+ * be automatically capitalized by Title::secureAndSpit()
+ * later on depending on $wgCapitalLinks)
*
* @param array $namespaces Namespaces to search in
* @param string $search term
@@ -104,12 +113,6 @@ class PrefixSearch {
* @return array of title strings
*/
protected static function defaultSearchBackend( $namespaces, $search, $limit ) {
- global $wgCapitalLinks, $wgContLang;
-
- if( $wgCapitalLinks ) {
- $search = $wgContLang->ucfirst( $search );
- }
-
$ns = array_shift($namespaces); // support only one namespace
if( in_array(NS_MAIN,$namespaces))
$ns = NS_MAIN; // if searching on many always default to main