Merge pull request #923 from owncloud/hooks_try_catch
wrap hooks into a try, catch to prevent a faulty app from crashing the request
This commit is contained in:
commit
811b571cb3
|
@ -59,7 +59,11 @@ class OC_Hook{
|
||||||
|
|
||||||
// Call all slots
|
// Call all slots
|
||||||
foreach( self::$registered[$signalclass][$signalname] as $i ) {
|
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
|
// return true
|
||||||
|
|
Loading…
Reference in New Issue