From: Tim Starling Date: Sat, 20 Aug 2005 13:47:12 +0000 (+0000) Subject: With the introduction of action=render, internal links may also contain http://,... X-Git-Tag: 1.6.0~1867 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=eea00a79be889ecf1b772139745482240af28463;p=lhc%2Fweb%2Fwiklou.git With the introduction of action=render, internal links may also contain , and so must be hardened against replacement by replaceExternalLinks in the same way as interwiki links. --- diff --git a/includes/Parser.php b/includes/Parser.php index 40afaed44d..eede52aeba 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1456,27 +1456,20 @@ class Parser $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail ); continue; } - if( !$nt->isExternal() && $nt->isAlwaysKnown() ) { - /** - * Skip lookups for special pages and self-links. - * External interwiki links are not included here because - * the HTTP urls would break output in the next parse step; - * they will have placeholders kept. - */ - $s .= $sk->makeKnownLinkObj( $nt, $text, '', $trail, $prefix ); - } else { - /** - * Add a link placeholder - * Later, this will be replaced by a real link, after the existence or - * non-existence of all the links is known - */ - $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix ); - } + $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix ); } wfProfileOut( $fname ); return $s; } + /** + * Hardens some text possibly containing URLs against mangling by + * replaceExternalLinks() + */ + function hardenURLs( $text ) { + return str_replace( 'http://', 'http-noparse://', $text ); + } + /** * Make a link placeholder. The text returned can be later resolved to a real link with * replaceLinkHolders(). This is done for two reasons: firstly to avoid further @@ -3023,7 +3016,7 @@ class Parser $pdbk = $pdbks[$key] = $title->getPrefixedDBkey(); # Check if it's in the link cache already - if ( $wgLinkCache->getGoodLinkID( $pdbk ) ) { + if ( $title->isAlwaysKnown() || $wgLinkCache->getGoodLinkID( $pdbk ) ) { $colours[$pdbk] = 1; } elseif ( $wgLinkCache->isBadLink( $pdbk ) ) { $colours[$pdbk] = 0;