From: This, that and the other Date: Sat, 16 Aug 2014 12:09:42 +0000 (+1000) Subject: Fix URL protocol detection regex for file link= parameter X-Git-Tag: 1.31.0-rc.0~14392^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=fb7e8b876aa5bb327b53f4794e37b2016240975c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 );