From 937e26a541e3144f6df812d7e8eb6de3d35f596d Mon Sep 17 00:00:00 2001 From: alecpl Date: Tue, 12 Oct 2010 08:44:25 +0000 Subject: [PATCH] - Fix links handling --- program/include/rcube_string_replacer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/program/include/rcube_string_replacer.php b/program/include/rcube_string_replacer.php index 0471dd0dc..326bb7f51 100644 --- a/program/include/rcube_string_replacer.php +++ b/program/include/rcube_string_replacer.php @@ -36,13 +36,14 @@ class rcube_string_replacer function __construct() { // Simplified domain expression for UTF8 characters handling - $utf_domain = '[^&@"\'\\/\s\r\t\n]+\\.[a-z]{2,5}'; + $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.[a-z]{2,5}'; + $url = '[a-z0-9%=#+?.:&\\/_-]+'; - $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain(\S+)?)/i"; + $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain($url)?)/i"; $this->mailto_pattern = "/(" ."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*" // local-part ."@$utf_domain" // domain-part - ."(\?\S+)?" // e.g. ?subject=test... + ."(\?$url)?" // e.g. ?subject=test... .")/i"; }