]> source.dussan.org Git - nextcloud-server.git/commitdiff
wrap hooks into a try, catch to prevent a faulty app from crashing the request
authorRobin Appelman <icewind@owncloud.com>
Sun, 16 Dec 2012 19:29:36 +0000 (20:29 +0100)
committerRobin Appelman <icewind@owncloud.com>
Sun, 16 Dec 2012 19:29:36 +0000 (20:29 +0100)
lib/hook.php

index 26a53693748052803b3771587ea18000e531a5c7..4da331bb5d80c9eed971b3951072eaa331004650 100644 (file)
@@ -59,7 +59,11 @@ class OC_Hook{
 
                // Call all slots
                foreach( self::$registered[$signalclass][$signalname] as $i ) {
-                       call_user_func( array( $i["class"], $i["name"] ), $params );
+                       try {
+                               call_user_func( array( $i["class"], $i["name"] ), $params );
+                       } catch (Exception $e){
+                               OC_Log::write('hook', 'error while running hook (' . $i["class"] . '::' . $i["name"] . '): '.$e->getMessage(), OC_Log::ERROR);
+                       }
                }
 
                // return true