From 88597cc944e75caa057aa161d7fac26f34f6d488 Mon Sep 17 00:00:00 2001 From: Ramunas Geciauskas Date: Tue, 8 Mar 2016 15:31:55 -0500 Subject: [PATCH] Normalize user provided URL link for Special:LinkSearch page Using Parser::normalizeLinkUrl() to normalize links before passing them to the Special:LinkSearch handler allows us to avoid URL encoding issues when searching for URL with special/escaped characters. E.g. As listed in T126913 currently user needs to provide URL exactly as it is stored in MediaWiki (' vs %27) in order to find it. Normalizing URL will allow searching in Special:LinkSearch page using both direct and encoded characters (since it will get normalized to the uniform format). Bug: T126913 Change-Id: If17b1896a3f40ba99c78fccb9f69100b2a0f5cba --- includes/specials/SpecialLinkSearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index bc33b8e053..2a7046ecbd 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -158,7 +158,7 @@ class LinkSearchPage extends QueryPage { if ( $target != '' ) { $this->setParams( [ - 'query' => $target2, + 'query' => Parser::normalizeLinkUrl( $target2 ), 'namespace' => $namespace, 'protocol' => $protocol ] ); parent::execute( $par ); -- 2.20.1