diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-12-16 20:29:36 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-12-16 20:29:36 +0100 |
commit | 4301cd7f61f0cf07458f49430c098aac04882fbc (patch) | |
tree | af7bc3f7e6c9a0cc62e5e14fcd271c72267b837a /lib/hook.php | |
parent | 0c87f666ad24492ec45e6d3c05f729132ae1a926 (diff) | |
download | nextcloud-server-4301cd7f61f0cf07458f49430c098aac04882fbc.tar.gz nextcloud-server-4301cd7f61f0cf07458f49430c098aac04882fbc.zip |
wrap hooks into a try, catch to prevent a faulty app from crashing the request
Diffstat (limited to 'lib/hook.php')
-rw-r--r-- | lib/hook.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/hook.php b/lib/hook.php index 26a53693748..4da331bb5d8 100644 --- a/lib/hook.php +++ b/lib/hook.php @@ -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 |