Fix maildrop rules without conditions (almarin@um.es, Bug #8103).
authorJan Schneider <jan@horde.org>
Mon, 23 Mar 2009 21:41:29 +0000 (22:41 +0100)
committerJan Schneider <jan@horde.org>
Mon, 23 Mar 2009 21:41:29 +0000 (22:41 +0100)
ingo/docs/CHANGES
ingo/lib/Script/maildrop.php

index c416445..1375587 100644 (file)
@@ -9,6 +9,7 @@ v2.0-git
 v1.2.2-cvs
 ----------
 
+[jan] Fix maildrop rules without conditions (almarin@um.es, Bug #8103).
 [cjh] Fix checks for the forward_file and forward_script procmail parameters
       in the VFS driver (Bug #7811).
 [cjh] Add %d (domain) as a replaceable variable in the vfs_path parameter
index ac2e84b..c72ecbc 100644 (file)
@@ -664,18 +664,19 @@ class Maildrop_Recipe {
             return '';
         }
 
-        $text[] = "if( \\";
+        if (count($this->_conditions) > 0) {
+
+            $text[] = "if( \\";
 
-        if (count($this->_conditions > 1)) {
             $nest = false;
             foreach ($this->_conditions as $condition) {
                 $cond = $nest ? $this->_combine : '   ';
                 $text[] = $cond . $condition['condition'] . $condition['flags'] . $condition['extra'] . " \\";
                 $nest = true;
             }
-        }
 
-        $text[] = ')';
+            $text[] = ')';
+        }
 
         foreach ($this->_action as $val) {
             $text[] = $val;