From: Tim Starling Date: Tue, 10 Aug 2004 11:24:24 +0000 (+0000) Subject: tweaking escaping of external links X-Git-Tag: 1.5.0alpha1~2441 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=d2ac7399cce5e88d0b6e5118da249d47018d5eab;p=lhc%2Fweb%2Fwiklou.git tweaking escaping of external links --- diff --git a/includes/Parser.php b/includes/Parser.php index 9e0f305c9e..3c539f0598 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1177,6 +1177,9 @@ class Parser $url = substr( $url, 0, -$numSepChars ); } + # Replace & from obsolete syntax with & + $url = str_replace( '&', '&', $url ); + # Is this an external image? $text = $this->maybeMakeImageLink( $url ); if ( $text === false ) { @@ -1197,7 +1200,7 @@ class Parser if ( $this->mOptions->getAllowExternalImages() ) { if ( preg_match( EXT_IMAGE_REGEX, $url ) ) { # Image found - $text = $sk->makeImage( $url ); + $text = $sk->makeImage( htmlspecialchars( $url ) ); } } return $text;