Merge "Unroll array_map in ResourceLoaderFileModule::readStyleFiles"
[lhc/web/wiklou.git] / includes / search / SearchEngine.php
index 4155635..882919f 100644 (file)
@@ -314,7 +314,7 @@ class SearchEngine {
                        $this->namespaces = null;
                        $parsed = substr( $query, strlen( $allkeyword ) );
                } elseif ( strpos( $query, ':' ) !== false ) {
-                       $prefix = substr( $query, 0, strpos( $query, ':' ) );
+                       $prefix = str_replace( ' ', '_', substr( $query, 0, strpos( $query, ':' ) ) );
                        $index = $wgContLang->getNsIndex( $prefix );
                        if ( $index !== false ) {
                                $this->namespaces = array( $index );
@@ -672,6 +672,15 @@ class SearchResultSet {
        function free() {
                // ...
        }
+
+       /**
+        * Did the search contain search syntax?  If so, Special:Search won't offer
+        * the user a link to a create a page named by the search string because the
+        * name would contain the search syntax.
+        */
+       public function searchContainedSyntax() {
+               return false;
+       }
 }
 
 /**