Skip to content

Commit

Permalink
[FrameworkBundle] Avoid listener key conflicts in ContainerAwareEvent…
Browse files Browse the repository at this point in the history
…Dispatcher

Since the key was previously concatenating service ID and method without a separator, it's possible that two different listeners could conflict (e.g. service/method pairs: foo/bar and fo/obar).
  • Loading branch information
jmikola committed Aug 24, 2011
1 parent 536538f commit 84c1719
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -86,7 +86,7 @@ public function dispatch($eventName, Event $event = null)
list($serviceId, $method, $priority) = $args;
$listener = $this->container->get($serviceId);

$key = $serviceId.$method;
$key = $serviceId.'.'.$method;
if (!isset($this->listeners[$eventName][$key])) {
$this->addListener($eventName, array($listener, $method), $priority);
} elseif ($listener !== $this->listeners[$eventName][$key]) {
Expand Down

0 comments on commit 84c1719

Please sign in to comment.