-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Ensure $request->hasSession() is always checked before calling getSession() #32703
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
Conversation
Any reason why you're proposing this? |
@nicolas-grekas |
We do not change code that works. We did such refactoring in the past and that introduced some bugs. So, we either refactor to fix a bug or we keep the current code. |
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.
I rebased this PR for 4.4 and reviewed the full code base to ensure we don't call getSession without checking hasSession before, as it is required now (getSession throws in 5.0 instead of returning null)
@nicolas-grekas thank you. |
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 like some tests are failing
@xabbuh fixed, thanks |
Thank you @Arman-Hosseini. |
…ling getSession() (Arman-Hosseini) This PR was merged into the 4.4 branch. Discussion ---------- Ensure $request->hasSession() is always checked before calling getSession() | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 7b2c326 Ensure $request->hasSession() is always checked before calling getSession()
Uh oh!
There was an error while loading. Please reload this page.