define( 'URL_PROTOCOLS', 'http|https|ftp|irc|gopher|news|mailto' );
define( 'HTTP_PROTOCOLS', 'http|https' );
# Everything except bracket, space, or control characters
-define( 'EXT_LINK_URL_CLASS', '[^]<>\\x00-\\x20\\x7F]' );
+define( 'EXT_LINK_URL_CLASS', '[^]\\x00-\\x20\\x7F]' );
# Including space
define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x00-\\x1F\\x7F]' );
define( 'EXT_IMAGE_FNAME_CLASS', '[A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]' );
* @access private
*/
function internalParse( $text, $linestart, $args = array(), $isMain=true ) {
- global $wgContLang;
+ global $wgContLang;
$fname = 'Parser::internalParse';
wfProfileIn( $fname );
$url = substr( $url, 0, -$numSepChars );
}
- # Replace & from obsolete syntax with &
- $url = str_replace( '&', '&', $url );
+ # Replace & from obsolete syntax with &;
+ # undo escaping of '<' and '>' by removeHTMLtags(),
+ # to prevent double-escaping. All HTML entities will
+ # be escaped by makeExternalLink() or maybeMakeImageLink()
+ $url = str_replace( array('&', '<', '>'), array('&', '<', '>'), $url );
# Is this an external image?
$text = $this->maybeMakeImageLink( $url );
}
}
- $text = $wgContLang->convert($text);
+ $text = $wgContLang->convert($text);
if( ( $nt->getPrefixedText() === $this->mTitle->getPrefixedText() ) &&
( strpos( $link, '#' ) === FALSE ) ) {