8000 Fix potential access to undefined index by Seldaek · Pull Request #15825 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix potential access to undefined index #15825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix potential access to undefined index
  • Loading branch information
Seldaek committed Sep 17, 2015
commit de41002f28436dcc8b555e9ae48032bf848d19c8
6 changes: 5 additions & 1 deletion src/Symfony/Component/EventDispatcher/EventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ public function dispatch($eventName, Event $event = null)
public function getListeners($eventName = null, $withPriorities = false)
{
if (true === $withPriorities) {
return $eventName ? $this->listeners[$eventName] : array_filter($this->listeners);
if (null !== $eventName) {
return isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : array();
}

return array_filter($this->listeners);
}

if (null !== $eventName) {
Expand Down
0