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

trac at roundcube.net trac at roundcube.net
Tue Oct 12 10:44:26 CEST 2010


Author: alec
Date: 2010-10-12 03:44:25 -0500 (Tue, 12 Oct 2010)
New Revision: 4076

Modified:
   trunk/roundcubemail/program/include/rcube_string_replacer.php
Log:
- Fix links handling


Modified: trunk/roundcubemail/program/include/rcube_string_replacer.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_string_replacer.php	2010-10-11 08:57:50 UTC (rev 4075)
+++ trunk/roundcubemail/program/include/rcube_string_replacer.php	2010-10-12 08:44:25 UTC (rev 4076)
@@ -36,13 +36,14 @@
   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";
   }
 

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



More information about the Svn mailing list