From: Rowan Collins Date: Sat, 20 Aug 2005 12:44:32 +0000 (+0000) Subject: (Bug 3090) mask all external links in image captions against double-parsing, rather... X-Git-Tag: 1.6.0~1869 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=96b9814683c092bcb80e150e70604fe4457fe326;p=lhc%2Fweb%2Fwiklou.git (Bug 3090) mask all external links in image captions against double-parsing, rather than just ones --- diff --git a/includes/Parser.php b/includes/Parser.php index 4f6fcba8d4..2c3b48bb1f 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -782,7 +782,7 @@ class Parser # replaceInternalLinks may sometimes leave behind # absolute URLs, which have to be masked to hide them from replaceExternalLinks - $text = str_replace("http-noparse://","http://",$text); + $text = str_replace(UNIQ_PREFIX."NOPARSE", "", $text); $text = $this->doMagicLinks( $text ); $text = $this->doTableStuff( $text ); @@ -1397,7 +1397,7 @@ class Parser $text = $this->replaceInternalLinks($text); # cloak any absolute URLs inside the image markup, so replaceExternalLinks() won't touch them - $s .= $prefix . str_replace('http://', 'http-noparse://', $this->makeImage( $nt, $text ) ) . $trail; + $s .= $prefix . preg_replace("/\b($wgUrlProtocols)/", UNIQ_PREFIX."NOPARSE$1", $this->makeImage( $nt, $text) ) . $trail; $wgLinkCache->addImageLinkObj( $nt ); wfProfileOut( "$fname-image" );