Update the Chinese conversion tables.
[lhc/web/wiklou.git] / includes / PrefixSearch.php
index 17f8ec1..10c8593 100644 (file)
@@ -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 );
                        }
@@ -128,7 +135,7 @@ class PrefixSearch {
 
                // Reformat useful data for future printing by JSON engine
                $srchres = array ();
-               foreach ($data['query']['allpages'] as & $pageinfo) {
+               foreach ((array)$data['query']['allpages'] as $pageinfo) {
                        // Note: this data will no be printable by the xml engine
                        // because it does not support lists of unnamed items
                        $srchres[] = $pageinfo['title'];