forked from extern/egroupware
"fix for bug #486: InfoLog removes https from urls on display
and some other fixes in the activation of url's"
This commit is contained in:
parent
668640f9a3
commit
dd45443d8e
@ -150,16 +150,16 @@ class html
|
|||||||
$content);
|
$content);
|
||||||
|
|
||||||
// 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:\/\/))'; // only http:// gets removed, other protocolls are shown
|
||||||
$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$4</a>", $result );
|
||||||
|
|
||||||
// Now match things beginning with www.
|
// Now match things beginning with www.
|
||||||
$NotHTTP = '(?<!:\/\/)';
|
$NotHTTP = '(?<!:\/\/)';
|
||||||
$Domain = 'www(.[\w]+)';
|
$Domain = 'www(\.[\w-.]+)';
|
||||||
$Subdir = '([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?';
|
$Subdir = '([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?';
|
||||||
$Expr = '/' . $NotAnchor . $NotHTTP . $Domain . $Subdir . '/i';
|
$Expr = '/' . $NotAnchor . $NotHTTP . $Domain . $Subdir . '/i';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user