Skip to content
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

Only start the session if needed to find data in FORM_DATA #1471

Merged
merged 2 commits into from Apr 11, 2018
Merged

Only start the session if needed to find data in FORM_DATA #1471

merged 2 commits into from Apr 11, 2018

Conversation

Toflar
Copy link
Member

@Toflar Toflar commented Apr 9, 2018

No description provided.

@Toflar Toflar mentioned this pull request Apr 9, 2018
9 tasks
if (isset($_SESSION['FORM_DATA'][$strKey]))
/** @var \Symfony\Component\HttpFoundation\Request $request */
$request = System::getContainer()->get('request_stack')->getMasterRequest();
if (null !== $request && $request->hasPreviousSession() && isset($_SESSION['FORM_DATA'][$strKey]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the isset() check not start the session already?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP will stop evaluating if the second or first condition evaluate to false already no? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True.

@leofeyer leofeyer added this to the 4.6.0 milestone Apr 10, 2018
@leofeyer leofeyer merged commit c8b298c into contao:master Apr 11, 2018
@leofeyer
Copy link
Member

Thank you @Toflar.

@Toflar Toflar deleted the form-data-session-handling branch April 11, 2018 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants