summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_string_replacer.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-12 08:44:25 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-12 08:44:25 +0000
commit57dc3a2e6d272093ee0f8c711a0f8d40266c3037 (patch)
treec136f32b597f7be5f584c470b4d31f16b8851835 /roundcubemail/program/include/rcube_string_replacer.php
parentdd2460ff8515948ada6f0904afe2a333afe442eb (diff)
- Fix links handling
git-svn-id: https://svn.roundcube.net/trunk@4076 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_string_replacer.php')
-rw-r--r--roundcubemail/program/include/rcube_string_replacer.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/roundcubemail/program/include/rcube_string_replacer.php b/roundcubemail/program/include/rcube_string_replacer.php
index 0471dd0dc..326bb7f51 100644
--- a/roundcubemail/program/include/rcube_string_replacer.php
+++ b/roundcubemail/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";
}