From 84c1719335cd7eb460b2d359fae7f853cf0ebf5a Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 24 Aug 2011 15:05:22 -0400 Subject: [PATCH] [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). --- .../Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php b/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php index fd1b2486089b..b1bd2201492c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php +++ b/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php @@ -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]) {