From 14e76278f3f4a3f9ce9ff2c56f12c899c74386a4 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 23 Mar 2009 22:41:29 +0100 Subject: [PATCH] Fix maildrop rules without conditions (almarin@um.es, Bug #8103). --- ingo/docs/CHANGES | 1 + ingo/lib/Script/maildrop.php | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ingo/docs/CHANGES b/ingo/docs/CHANGES index c4164459e..13755874e 100644 --- a/ingo/docs/CHANGES +++ b/ingo/docs/CHANGES @@ -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 diff --git a/ingo/lib/Script/maildrop.php b/ingo/lib/Script/maildrop.php index ac2e84b8a..c72ecbcdc 100644 --- a/ingo/lib/Script/maildrop.php +++ b/ingo/lib/Script/maildrop.php @@ -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; -- 2.11.0