Don't throw notices if the log event doesn't have a field that the filter has a
authorChuck Hagenbuch <chuck@horde.org>
Fri, 2 Oct 2009 00:42:43 +0000 (20:42 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Fri, 2 Oct 2009 00:59:31 +0000 (20:59 -0400)
constraint for.

framework/Log/lib/Horde/Log/Filter/Constraint.php

index 67d24b7..e5100de 100644 (file)
@@ -117,7 +117,8 @@ class Horde_Log_Filter_Constraint implements Horde_Log_Filter_Interface
     public function accept($event)
     {
         foreach ($this->_constraints as $field => $constraint) {
-            if (!$constraint->evaluate($event[$field])) {
+            $value = isset($event[$field]) ? $event[$field] : null;
+            if (!$constraint->evaluate($value)) {
                 return false;
             }
         }