MFB: Use preg_quote instead of quotemeta (Bug #8875).
authorJan Schneider <jan@horde.org>
Wed, 17 Mar 2010 17:25:31 +0000 (18:25 +0100)
committerJan Schneider <jan@horde.org>
Wed, 17 Mar 2010 17:25:50 +0000 (18:25 +0100)
ingo/docs/CHANGES
ingo/lib/Script/Procmail/Recipe.php

index f8817ff..b90cb59 100644 (file)
@@ -10,6 +10,7 @@ v2.0-git
 v1.2.4-cvs
 ----------
 
+[jan] Correctly escape addresses in procmail driver (Bug #8875).
 [jan] Fix procmail scripts when using composite headers (Bug #8804).
 [jan] Support some non-standard Date: headers in Sieve vacation rules
       (Request #8783).
index 50fe06a..e49ecd6 100644 (file)
@@ -301,21 +301,21 @@ class Ingo_Script_Procmail_Recipe
             break;
 
         case 'address':
-            $string .= '(.*\<)?' . quotemeta($condition['value']);
+            $string .= '(.*\<)?' . preg_quote($condition['value']);
             break;
 
         case 'not begins with':
             $reverseCondition = true;
             // fall through
         case 'begins with':
-            $string .= $prefix . quotemeta($condition['value']);
+            $string .= $prefix . preg_quote($condition['value']);
             break;
 
         case 'not ends with':
             $reverseCondition = true;
             // fall through
         case 'ends with':
-            $string .= '.*' . quotemeta($condition['value']) . '$';
+            $string .= '.*' . preg_quote($condition['value']) . '$';
             break;
 
         case 'not contain':
@@ -323,7 +323,7 @@ class Ingo_Script_Procmail_Recipe
             // fall through
         case 'contains':
         default:
-            $string .= '.*' . quotemeta($condition['value']);
+            $string .= '.*' . preg_quote($condition['value']);
             break;
         }