r10661 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10660‎ | r10661 | r10662 >
Date:12:44, 20 August 2005
Author:imsop
Status:old
Tags:
Comment:
(Bug 3090) mask all external links in image captions against double-parsing, rather than just http:// ones
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -782,7 +782,7 @@
783783
784784 # replaceInternalLinks may sometimes leave behind
785785 # absolute URLs, which have to be masked to hide them from replaceExternalLinks
786 - $text = str_replace("http-noparse://","http://",$text);
 786+ $text = str_replace(UNIQ_PREFIX."NOPARSE", "", $text);
787787
788788 $text = $this->doMagicLinks( $text );
789789 $text = $this->doTableStuff( $text );
@@ -1397,7 +1397,7 @@
13981398 $text = $this->replaceInternalLinks($text);
13991399
14001400 # cloak any absolute URLs inside the image markup, so replaceExternalLinks() won't touch them
1401 - $s .= $prefix . str_replace('http://', 'http-noparse://', $this->makeImage( $nt, $text ) ) . $trail;
 1401+ $s .= $prefix . preg_replace("/\b($wgUrlProtocols)/", UNIQ_PREFIX."NOPARSE$1", $this->makeImage( $nt, $text) ) . $trail;
14021402 $wgLinkCache->addImageLinkObj( $nt );
14031403
14041404 wfProfileOut( "$fname-image" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r10662(Bug 3090) mask all external links in image captions against double-parsing, ...imsop12:51, 20 August 2005
r35828Revert r35819 -- broke thumbnailing....brion23:46, 3 June 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r10464Parser test for bug 3090imsop22:51, 12 August 2005
r10465Parser test for bug 3090 (I knew I'd get CVS wrong)imsop23:46, 12 August 2005

Status & tagging log