Catch and log exceptions in __toString() rather than causing a fatal error
authorChuck Hagenbuch <chuck@horde.org>
Wed, 24 Nov 2010 04:47:21 +0000 (23:47 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 24 Nov 2010 04:47:21 +0000 (23:47 -0500)
framework/Core/lib/Horde/Themes/Element.php

index 3f0d787..b5444cf 100644 (file)
@@ -90,7 +90,12 @@ class Horde_Themes_Element
      */
     public function __toString()
     {
-        return (string)$this->uri;
+        try {
+            return (string)$this->uri;
+        } catch (Exception $e) {
+            Horde::logMessage($e, 'ERR');
+            return '';
+        }
     }
 
     /**