From: Nik Everett Date: Tue, 4 Feb 2014 15:54:51 +0000 (-0500) Subject: Handle space in namespace prefixed searches X-Git-Tag: 1.31.0-rc.0~17031 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=f8dbaac443a5cc58a8849bd8e9c0928897aa7991;p=lhc%2Fweb%2Fwiklou.git Handle space in namespace prefixed searches MWSearch handles namespace prefixed searches containing spaces so core should as well. Bug: 60489 Change-Id: I7e602d005a8b2786942b76b7185882e5107942c4 --- 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 );