fixed bug [ 1106069 ] bad hypertext link creation when '&' is in the URL

This commit is contained in:
Ralf Becker 2005-02-09 16:49:47 +00:00
parent 4425e6383a
commit a029793462

View File

@ -110,7 +110,7 @@ class html
// First match things beginning with http:// (or other protocols) // First match things beginning with http:// (or other protocols)
$Protocol = '(http|ftp|https):\/\/'; $Protocol = '(http|ftp|https):\/\/';
$Domain = '([\w]+.[\w]+)'; $Domain = '([\w]+.[\w]+)';
$Subdir = '([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?'; $Subdir = '([\w\-\.,@?^=%&;:\/~\+#]*[\w\-\@?^=%&\/~\+#])?';
$Expr = '/' . $NotAnchor . $Protocol . $Domain . $Subdir . '/i'; $Expr = '/' . $NotAnchor . $Protocol . $Domain . $Subdir . '/i';
$result = preg_replace( $Expr, "<a href=\"$0\" target=\"_blank\">$2$3</a>", $result ); $result = preg_replace( $Expr, "<a href=\"$0\" target=\"_blank\">$2$3</a>", $result );