r10662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10661‎ | r10662 | r10663 >
Date:12:51, 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:
  • /branches/REL1_5/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: branches/REL1_5/phase3/includes/Parser.php
@@ -773,7 +773,7 @@
774774
775775 # replaceInternalLinks may sometimes leave behind
776776 # absolute URLs, which have to be masked to hide them from replaceExternalLinks
777 - $text = str_replace("http-noparse://","http://",$text);
 777+ $text = str_replace(UNIQ_PREFIX."NOPARSE", "", $text);
778778
779779 $text = $this->doMagicLinks( $text );
780780 $text = $this->doTableStuff( $text );
@@ -1388,7 +1388,7 @@
13891389 $text = $this->replaceInternalLinks($text);
13901390
13911391 # cloak any absolute URLs inside the image markup, so replaceExternalLinks() won't touch them
1392 - $s .= $prefix . str_replace('http://', 'http-noparse://', $this->makeImage( $nt, $text ) ) . $trail;
 1392+ $s .= $prefix . preg_replace("/\b($wgUrlProtocols)/", UNIQ_PREFIX."NOPARSE$1", $this->makeImage( $nt, $text) ) . $trail;
13931393 $wgLinkCache->addImageLinkObj( $nt );
13941394
13951395 wfProfileOut( "$fname-image" );

Follow-up revisions

RevisionCommit summaryAuthorDate
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
r10661(Bug 3090) mask all external links in image captions against double-parsing, ...imsop12:44, 20 August 2005

Status & tagging log