diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Hooks.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/system/core/Hooks.php b/system/core/Hooks.php index f6eff4b3f..767dc4cd9 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -154,7 +154,16 @@ class CI_Hooks { */ protected function _run_hook($data) { - if ( ! is_array($data)) + // Closures/lambda functions and array($object, 'method') callables + if (is_callable($data)) + { + is_array($data) + ? $data[0]->{$data[1]}() + : $data(); + + return TRUE; + } + elseif ( ! is_array($data)) { return FALSE; } |