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

Use validateData() to validate POST data only #8156

Closed
wants to merge 1 commit into from
Closed

Use validateData() to validate POST data only #8156

wants to merge 1 commit into from

Conversation

obozdag
Copy link
Contributor

@obozdag obozdag commented Nov 6, 2023

Instead of withRequest(), use validateData() to validate POST data only. withRequest() uses $request->getVar() which returns $_GET, $_POST and $_COOKIE data in that order. Newer values override older values. Post values will be overriden by the cookies if they have the same name.

Description
Explain what you have changed, and why.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Instead of withRequest(), use validateData() to validate POST data only. withRequest() uses $request->getVar() which returns $_GET, $_POST and $_COOKIE data in that order. Newer values override older values. Post values will be overriden by the cookies if they have the same name.
@kenjis
Copy link
Member

kenjis commented Nov 6, 2023

Duplicate of #8157

@kenjis kenjis marked this as a duplicate of #8157 Nov 6, 2023
@kenjis kenjis closed this Nov 6, 2023
@obozdag
Copy link
Contributor Author

obozdag commented Nov 6, 2023

user_guide_src/source/libraries/validation.rst and user_guide_src/source/incoming/controllers.rst files have similar warnings. That is why I have changed those two files.

@kenjis
Copy link
Member

kenjis commented Nov 7, 2023

I thought the same submission was sent twice because it was the same subject.

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.

2 participants