jenkins-bot has submitted this change and it was merged.

Change subject: Handle space in namespace prefixed searches
......................................................................


Handle space in namespace prefixed searches

MWSearch handles namespace prefixed searches containing spaces so core
should as well.

Bug: 60489
Change-Id: I7e602d005a8b2786942b76b7185882e5107942c4
---
M includes/search/SearchEngine.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php
index 4155635..51cc539 100644
--- a/includes/search/SearchEngine.php
+++ b/includes/search/SearchEngine.php
@@ -314,7 +314,7 @@
                        $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 );

-- 
To view, visit https://gerrit.wikimedia.org/r/111204
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e602d005a8b2786942b76b7185882e5107942c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to