(bug 29497) To support protocol-relative URLs in external links, add '//' to $wgUrlPr...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 7 Jul 2011 18:26:24 +0000 (18:26 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 7 Jul 2011 18:26:24 +0000 (18:26 +0000)
includes/DefaultSettings.php
includes/parser/Parser.php

index e5b05f9..e6b02f8 100644 (file)
@@ -2790,6 +2790,7 @@ $wgUrlProtocols = array(
        'svn://',
        'git://',
        'mms://',
+       '//', // for protocol-relative URLs
 );
 
 /**
index 39637bf..6227ac3 100644 (file)
@@ -183,7 +183,7 @@ class Parser {
        public function __construct( $conf = array() ) {
                $this->mConf = $conf;
                $this->mUrlProtocols = wfUrlProtocols();
-               $this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'.
+               $this->mExtLinkBracketedRegex = '/\[((' . wfUrlProtocols() . ')'.
                        '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/S';
                if ( isset( $conf['preprocessorClass'] ) ) {
                        $this->mPreprocessorClass = $conf['preprocessorClass'];