[icinga-checkins] icinga.org: icingaweb2/master: FilterEditor: add failsafe string cast

git at icinga.org git at icinga.org
Sun Nov 16 00:38:41 CET 2014


Module: icingaweb2
Branch: master
Commit: a75bfd1dfb9f5025fcf5bf86e9e7bb01ddf6d214
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=a75bfd1dfb9f5025fcf5bf86e9e7bb01ddf6d214

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sat Nov 15 22:50:35 2014 +0100

FilterEditor: add failsafe string cast

---

 library/Icinga/Web/Widget/FilterEditor.php |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php
index f91c446..3b4f721 100644
--- a/library/Icinga/Web/Widget/FilterEditor.php
+++ b/library/Icinga/Web/Widget/FilterEditor.php
@@ -243,4 +243,13 @@ class FilterEditor extends AbstractWidget
               . '</li></ul><br /><input type="submit" name="submit" value="Apply" />'
               . '</form>';
     }
+
+    public function __toString()
+    {
+        try {
+            return $this->render();
+        } catch (Exception $e) {
+            return 'ERROR in FilterEditor: ' . $e->getMessage();
+        }
+    }
 }



More information about the icinga-checkins mailing list