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

trac at roundcube.net trac at roundcube.net
Thu Feb 17 10:51:27 CET 2011


Author: alec
Date: 2011-02-17 03:51:26 -0600 (Thu, 17 Feb 2011)
New Revision: 4559

Modified:
   trunk/roundcubemail/program/include/rcube_imap_generic.php
Log:
- Use addcslashes() instead of strtr() for string quoting


Modified: trunk/roundcubemail/program/include/rcube_imap_generic.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap_generic.php	2011-02-17 09:45:34 UTC (rev 4558)
+++ trunk/roundcubemail/program/include/rcube_imap_generic.php	2011-02-17 09:51:26 UTC (rev 4559)
@@ -3321,7 +3321,7 @@
         else if ($force_quotes ||
             preg_match('/([\x00-\x20\x28-\x29\x7B\x25\x2A\x22\x5B\x5C\x5D\x7F]+)/', $string)
         ) {
-            return '"' . strtr($string, array('"'=>'\\"', '\\' => '\\\\')) . '"';
+            return '"' . addcslashes($string, '\\"') . '"';
         }
 
         // atom
@@ -3330,7 +3330,7 @@
 
     static function unEscape($string)
     {
-        return strtr($string, array('\\"'=>'"', '\\\\' => '\\'));
+        return stripslashes($string);
     }
 
     /**

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



More information about the Svn mailing list