From 96b9814683c092bcb80e150e70604fe4457fe326 Mon Sep 17 00:00:00 2001 From: Rowan Collins Date: Sat, 20 Aug 2005 12:44:32 +0000 Subject: [PATCH] (Bug 3090) mask all external links in image captions against double-parsing, rather than just http:// ones --- includes/Parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" ); -- 2.20.1