Commit caa974ba authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Ensure event callbacks always get an array

parent e3180674
......@@ -661,10 +661,18 @@ function handle_event($event, $data) {
throw new Exception("Invalid event");
}
if (is_object($data)) {
$data = (array)$data;
}
if (is_numeric($data)) {
$data = array('id' => $data);
}
// this is here because the core can't listen to events
// @todo, this is VERY ugly, and someone should fix it
if ($event == 'createuser') {
activity_set_defaults($data->id);
activity_set_defaults($data['id']);
}
$plugintypes = plugin_types();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment