From 7ecaa98da9d53851ed2319d61eefa2e8f0632348 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sat, 14 Apr 2012 18:07:51 +0100 Subject: [PATCH] (bug 34956) Parser should use mUrlProtocol instead of wfUrlProtocols() Change-Id: I069f21f86bbca55cf05f9a44b2ff3ea960c8af12 --- includes/parser/Parser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 89540316f5..fed3bdc91d 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -188,7 +188,7 @@ class Parser { public function __construct( $conf = array() ) { $this->mConf = $conf; $this->mUrlProtocols = wfUrlProtocols(); - $this->mExtLinkBracketedRegex = '/\[((' . wfUrlProtocols() . ')'. + $this->mExtLinkBracketedRegex = '/\[((' . $this->mUrlProtocols . ')'. self::EXT_LINK_URL_CLASS.'+)\p{Zs}*([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]/Su'; if ( isset( $conf['preprocessorClass'] ) ) { $this->mPreprocessorClass = $conf['preprocessorClass']; @@ -1814,7 +1814,7 @@ class Parser { # Don't allow internal links to pages containing # PROTO: where PROTO is a valid URL protocol; these # should be external links. - if ( preg_match( '/^(?:' . wfUrlProtocols() . ')/', $m[1] ) ) { + if ( preg_match( '/^(?:' . $this->mUrlProtocols . ')/', $m[1] ) ) { $s .= $prefix . '[[' . $line ; wfProfileOut( __METHOD__."-misc" ); continue; @@ -2051,7 +2051,7 @@ class Parser { * @return String: less-or-more HTML with NOPARSE bits */ function armorLinks( $text ) { - return preg_replace( '/\b(' . wfUrlProtocols() . ')/', + return preg_replace( '/\b(' . $this->mUrlProtocols . ')/', "{$this->mUniqPrefix}NOPARSE$1", $text ); } @@ -5562,7 +5562,7 @@ class Parser { # @todo FIXME: Not tolerant to blank link text # I.E. [http://www.mediawiki.org] will render as [1] or something depending # on how many empty links there are on the page - need to figure that out. - $text = preg_replace( '/\[(?:' . wfUrlProtocols() . ')([^ ]+?) ([^[]+)\]/', '$2', $text ); + $text = preg_replace( '/\[(?:' . $this->mUrlProtocols . ')([^ ]+?) ([^[]+)\]/', '$2', $text ); # Parse wikitext quotes (italics & bold) $text = $this->doQuotes( $text ); -- 2.20.1