From fb7e8b876aa5bb327b53f4794e37b2016240975c Mon Sep 17 00:00:00 2001 From: "This, that and the other" Date: Sat, 16 Aug 2014 22:09:42 +1000 Subject: [PATCH] Fix URL protocol detection regex for file link= parameter This regex looked something like /^(?i)bitcoin:|ftp://|ftps://|.../, which meant the anchoring ^ only applied to the first name. This meant that any link= value that happened to contain a URL protocol anywhere within it (e.g. wikinews:Foo containing "news:") got incorrectly matched by this regex. Bug: 69317 Change-Id: Ide1c4f64137666db99f8e3b6816df01ef5099c8e --- includes/parser/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index c5c472ada8..61fffc5564 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5527,7 +5527,7 @@ class Parser { $paramName = 'no-link'; $value = true; $validated = true; - } elseif ( preg_match( "/^(?i)$prots/", $value ) ) { + } elseif ( preg_match( "/^((?i)$prots)/", $value ) ) { if ( preg_match( "/^((?i)$prots)$chars+$/u", $value, $m ) ) { $paramName = 'link-url'; $this->mOutput->addExternalLink( $value ); -- 2.20.1