Skip to content

Commit 6ef277d

Browse files
committed
[FrameworkBundle] Avoid listener key conflicts in ContainerAwareEventDispatcher
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).
1 parent cc5855c commit 6ef277d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ContainerAwareEventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function dispatch($eventName, Event $event = null)
8686
list($serviceId, $method, $priority) = $args;
8787
$listener = $this->container->get($serviceId);
8888

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

0 commit comments

Comments
 (0)