[Svn] r3888 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Tue Aug 10 09:53:17 CEST 2010


Author: alec
Date: 2010-08-10 02:53:17 -0500 (Tue, 10 Aug 2010)
New Revision: 3888

Modified:
   trunk/roundcubemail/program/include/rcube_string_replacer.php
Log:
- Improve email regexp in mailto: links handler (#1486808)


Modified: trunk/roundcubemail/program/include/rcube_string_replacer.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_string_replacer.php	2010-08-10 06:32:50 UTC (rev 3887)
+++ trunk/roundcubemail/program/include/rcube_string_replacer.php	2010-08-10 07:53:17 UTC (rev 3888)
@@ -39,7 +39,10 @@
     $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";
   }
 
   /**

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list