fix reading/saving flags when editing/creating a new rule
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 14:19:34 +0000 (10:19 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 14:21:18 +0000 (10:21 -0400)
ingo/rule.php

index 5d7f95f..5c3d34b 100644 (file)
@@ -113,11 +113,9 @@ case 'rule_delete':
     $rule['stop'] = $vars->stop;
 
     $rule['flags'] = 0;
-    $flags = $vars->flags || array();
-    if (!empty($flags)) {
-        foreach ($flags as $val) {
-            $rule['flags'] |= $val;
-        }
+    $flags = empty($vars->flags) ? array() : $vars->flags;
+    foreach ($flags as $val) {
+        $rule['flags'] |= $val;
     }
 
     /* Update the timestamp for the rules. */