xmpp icon indicating copy to clipboard operation
xmpp copied to clipboard

Wrongly calling call_user_func with an array in eventmanager

Open thedjnK opened this issue 9 years ago • 1 comments

There is an issue with this code in the eventmanager:

public function trigger($event, $caller, array $parameters)
...
$callbacks = array_merge($events, $this->events[self::WILDCARD]);
...
do {
$current = array_shift($callbacks);
call_user_func($current, $eventObject);

$current is usually an array which it shouldn't be (PHP Notice: Array to string conversion in /tmp/src/Event/EventManager.php on line 128)

thedjnK avatar Feb 18 '16 21:02 thedjnK

Somehow I don't see an Issue here. $callbacks should always be an array and that $current is callable is checked when attaching to an event.

fabiang avatar May 23 '17 12:05 fabiang