summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-08-10 07:53:17 +0000
committeralecpl <alec@alec.pl>2010-08-10 07:53:17 +0000
commitb6244d5ce7aa442d14dcd4c0cdf828dc22027af9 (patch)
tree65870ae4cf2889a1057725a71ff9f2ac0d8390b2 /program
parent27a96a40db9d165f57ef64f09a2a7ef572ab58c2 (diff)
- Improve email regexp in mailto: links handler (#1486808)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_string_replacer.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/include/rcube_string_replacer.php b/program/include/rcube_string_replacer.php
index 03c04dd63..0568cc072 100644
--- a/program/include/rcube_string_replacer.php
+++ b/program/include/rcube_string_replacer.php
@@ -39,7 +39,10 @@ class rcube_string_replacer
$url_chars_within = '\?\.~,!';
$this->link_pattern = "/([\w]+:\/\/|\Wwww\.)([a-z0-9\-\.]+[a-z]{2,4}([$url_chars$url_chars_within]*[$url_chars])?)/i";
- $this->mailto_pattern = "/([a-z0-9][a-z0-9\-\.\+\_]*@([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z]{2,5})/i";
+ $this->mailto_pattern = "/("
+ ."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*" // local-part
+ ."@([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z]{2,5}" // domain-part
+ .")/i";
}
/**