Thanks to visit codestin.com
Credit goes to github.com

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

Fix potential access to undefined index #15825

merged 1 commit into from
Oct 11, 2015

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Sep 17, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Fixes @Tobion's comment in https://github.com/symfony/symfony/pull/14563/files#r39705270

@Tobion
Copy link
Contributor

Tobion commented Sep 18, 2015

The whole withPriorities logic is very fragile as this parameter is not part of the interface.
But all descriptors are typehinted against the interface but rely on the fact that the withPriorities is understood. Otherwise the descriptors will fail. So what is the plan for 3.0? Add the paramter to the interface? Or maybe its better to create a dedicated method for that. Currently the return structure depends on the paramters which is usually really bad.

But something needs to be added for #11742

@fabpot
Copy link
Member

fabpot commented Oct 11, 2015

Thank you @Seldaek.

@fabpot fabpot merged commit de41002 into symfony:2.8 Oct 11, 2015
fabpot added a commit that referenced this pull request Oct 11, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

Fix potential access to undefined index

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Fixes @Tobion's comment in https://github.com/symfony/symfony/pull/14563/files#r39705270

Commits
-------

de41002 Fix potential access to undefined index
@fabpot
Copy link
Member

fabpot commented Oct 11, 2015

We still have 2 months to fix what @Tobion describes as the original PR as merged in 2.8. I will try to propose something later today.

@fabpot
Copy link
Member

fabpot commented Oct 11, 2015

see #16198

fabpot added a commit that referenced this pull request Oct 12, 2015
…iority() (fabpot)

This PR was merged into the 2.8 branch.

Discussion
----------

[EventDispatcher] added EventDispatcher::getListenerPriority()

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14563, #15825
| License       | MIT
| Doc PR        | n/a

In #14563, we added a way to get the priorities of listeners, but as noted by @Tobion in #15825, the implementation is sub-optimal because of two main reasons: the change is not part of the interface but more importantly, the added boolean changes the return value of `getListeners()`.

This PR reverts most of #14563 to add a `getListenerPriority()` method. This method is quite slow, but as it should only be used for debugging purposes (on the CLI or the WDT), I think it's not really a problem.

In 3.0, this method should probably be added to `EventDispatcherInterface`.

ping @Tobion

Commits
-------

068e955 [EventDispatcher] added EventDispatcher::getListenerPriority()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants