From 3da64025c42e5fd0358801491857b293415f3652 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Fri, 23 Apr 2010 21:53:03 -0400 Subject: [PATCH] __toString can't throw an exception or PHP dies, so wrap registry calls in try/catch --- framework/Core/lib/Horde/Core/Notification/Status.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/Core/lib/Horde/Core/Notification/Status.php b/framework/Core/lib/Horde/Core/Notification/Status.php index 81d5db92c..9d38bb8ae 100644 --- a/framework/Core/lib/Horde/Core/Notification/Status.php +++ b/framework/Core/lib/Horde/Core/Notification/Status.php @@ -47,13 +47,21 @@ class Horde_Core_Notification_Status extends Horde_Notification_Event_Status $text = $alarm['title']; if (!empty($alarm['params']['notify']['show'])) { - $text = Horde::link(Horde::url($GLOBALS['registry']->linkByPackage($alarm['params']['notify']['show']['__app'], 'show', $alarm['params']['notify']['show'])), $alarm['text']) . $text . ''; + try { + $text = Horde::link(Horde::url($GLOBALS['registry']->linkByPackage($alarm['params']['notify']['show']['__app'], 'show', $alarm['params']['notify']['show'])), $alarm['text']) . $text . ''; + } catch (Horde_Exception $e) { + return $e->getMessage(); + } } if (!empty($alarm['user']) && $GLOBALS['browser']->hasFeature('xmlhttpreq')) { Horde::addScriptFile('prototype.js', 'horde'); - $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/snooze.php', true); + try { + $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/snooze.php', true); + } catch (Horde_Exception $e) { + return $e->getMessage(); + } $opts = array( '-1' => _("Dismiss"), '5' => _("5 minutes"), -- 2.11.0