From: Jan Schneider Date: Tue, 18 Aug 2009 08:52:31 +0000 (+0200) Subject: Fix negating instanceof. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7929c73a87a89f86f6d233121b5a57f91bf9f7b7;p=horde.git Fix negating instanceof. Handle exceptions. --- diff --git a/framework/Notification/lib/Horde/Notification.php b/framework/Notification/lib/Horde/Notification.php index a45e50c70..ae2efafe1 100644 --- a/framework/Notification/lib/Horde/Notification.php +++ b/framework/Notification/lib/Horde/Notification.php @@ -159,14 +159,15 @@ class Horde_Notification */ public function push($event, $type = null, $flags = array()) { - if (!$event instanceof Horde_Notification_Event && - !$event instanceof PEAR_Error) { + if (!($event instanceof Horde_Notification_Event) && + !($event instanceof PEAR_Error) && + !($event instanceof Exception)) { /* Transparently create a Horde_Notification_Event object and * set the message attribute. */ $event = new Horde_Notification_Event($event); } - if ($event instanceof PEAR_Error) { + if ($event instanceof PEAR_Error || $event instanceof Exception) { if (is_null($type)) { $type = 'horde.error'; }