From f8dbaac443a5cc58a8849bd8e9c0928897aa7991 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 4 Feb 2014 10:54:51 -0500 Subject: [PATCH] Handle space in namespace prefixed searches MWSearch handles namespace prefixed searches containing spaces so core should as well. Bug: 60489 Change-Id: I7e602d005a8b2786942b76b7185882e5107942c4 --- includes/search/SearchEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 4155635b91..51cc539f71 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -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 ); -- 2.20.1