Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
caa974ba
Commit
caa974ba
authored
Feb 13, 2007
by
Martyn Smith
Committed by
Martyn Smith
Feb 13, 2007
Browse files
Ensure event callbacks always get an array
parent
e3180674
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
caa974ba
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment