- Fix links handling

release-0.6
alecpl 14 years ago
parent bb269962fa
commit 937e26a541

@ -36,13 +36,14 @@ class rcube_string_replacer
function __construct() function __construct()
{ {
// Simplified domain expression for UTF8 characters handling // 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 = "/(" $this->mailto_pattern = "/("
."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*" // local-part ."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*" // local-part
."@$utf_domain" // domain-part ."@$utf_domain" // domain-part
."(\?\S+)?" // e.g. ?subject=test... ."(\?$url)?" // e.g. ?subject=test...
.")/i"; .")/i";
} }

Loading…
Cancel
Save