-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Bugfix #10912 (Micro Middleware (before) does not stop operation) #10931
Conversation
Just to make sure, return false does not stop the events? |
Yes. |
👍 |
1 similar comment
👍 |
@pauliuspetronis Could you please rebase onto 3.2.x branch |
@sergeyklay - done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@pauliuspetronis Could you please update CHANGELOG.md |
@sergeyklay - updated. But I think the same problem is with afterBindingHandlers. Or I'm wrong? |
@pauliuspetronis Looks like yes. Anyway it should be in separated PR. Thank you for contributing ! |
First of all, I would like to say thanks for this awesome framework and awesome work. Really appreciate it. We love using PHP and Phalcon in our projects, we've already written several separate libraries to make the best use of Phalcon (here is an example). However, by changing a crucial functionality like this (calling return false does not stop the execution on before) broke most of our applications that are live today, causing huge security issues. It is unpleasant to be aware of this after it is been a while since this change was released. Maybe I have to check here more often, but we are already dependent on lots of other libraries too, and checking them all is not always possible. Please be more careful not to break people's code who loves using Phalcon in the future. |
In this pull request is one important change.
before this change:
event
(before) is closure and return false - cancels the route executionevent
(before) isMiddlewareInterface
object and return false/true/... - not cancels route executionIn this change:
event
(before) is closure and return false/true/... - not cancels route executionevent
(before) isMiddlewareInterface
and return false/true/... - not cancels route executionIf you need to cancel execution on
event
(before) - in both cases must be called$microApplication->stop();
For example:
or