From: David Causse Date: Tue, 6 Nov 2018 14:52:08 +0000 (+0100) Subject: Completion search should not change the search query X-Git-Tag: 1.31.2~63 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=29ef5f88ab95a7df05d5b48cced165bcc2f88b60 Completion search should not change the search query when extracting the namespace Bug: T208255 Change-Id: I98206bda9a32e12acc7e515c3396fa823c3cd4f3 --- diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 7e6e8e6d0d..bfcfb59804 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -443,7 +443,9 @@ abstract class SearchEngine { $ns = $this->namespaces; if ( $title && !$title->isExternal() ) { $ns = [ $title->getNamespace() ]; - $search = $title->getText(); + if ( $title->getNamespace() !== NS_MAIN ) { + $search = substr( $search, strpos( $search, ':' ) + 1 ); + } if ( $ns[0] == NS_MAIN ) { $ns = $this->namespaces; // no explicit prefix, use default namespaces Hooks::run( 'PrefixSearchExtractNamespace', [ &$ns, &$search ] );