[ingo] comparing custom header to zero => You cannot create empty conditions ; -(

Jan Schneider jan at horde.org
Wed Feb 18 14:08:02 UTC 2009


Zitat von Thomas Bätzler <t.baetzler at bringe.com>:

> Hi,
>
> this is with regard to INGO H3 1.2 as shipped in Horde Webmail 1.1.5
> using a sieve backend.
>
> I'm trying to set up a rule to match for the custom header line
> "X-GMX-Antispam: 0", which I would expect to look something like this:
>
>   if header :value "eq" :comparator "i;ascii-numeric" "X-GMX-Antispam"
> "0"  {
>       keep;
>   }
>
> If I use Ingo to create a rule like this ("Self-defined Header"
> "X-GMX-Antispam" "Is" "0"), I get the error shown above.
>
> I've tracked this message to this block in rule.php at line 91:
>
>             if ($actionID == 'rule_save'
>                 && empty($value[$key])
>                 && $condition['match'] != 'exists'
>                 && $condition['match'] != 'not exist') {
>                 $notification->push(sprintf(_("You cannot create empty
> conditions. Please fill in a value for \"%s\"."), $condition['field']),
> 'horde.error');
>                 $valid = false;
>             }
>
> I haven't checked the version history of this file but I suspect that
> the empty() is part f a fix for http://bugs.horde.org/ticket/5641

That should probably be a !strlen() check instead.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the ingo mailing list