You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony version(s) affected: all supported versions (and >=2.1, too)
Description
Given that HTTP method override is active, setting an array as _method parameter in a random form with POST method raises a PHP warning.
How to reproduce
Activate HTTP method override
framework:
http_method_override: true
Submit a random form with POST method to a URL which contains an array as _method query parameter (e. g. https://example.com?_method[]=foo&_method[]=bar).
Possible Solution Request::getMethod() should check the type of the acquired _method value and don't use it if it is no string.
Additional context
PHP Warning: strtoupper() expects parameter 1 to be string, array given in var/bootstrap.php.cache on line 977
bootstrap.php.cache line 977 is equivalent to src/Symfony/Component/HttpFoundation/Request.php
…d type (Phobetor)
This PR was squashed before being merged into the 2.8 branch (closes#28080).
Discussion
----------
[HttpFoundation] fixed using _method parameter with invalid type
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28079
| License | MIT
| Doc PR | -
This change makes sure that an incoming `_method` parameter is only used when it is a string value.
Commits
-------
63583de [HttpFoundation] fixed using _method parameter with invalid type
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: all supported versions (and >=2.1, too)
Description
Given that HTTP method override is active, setting an array as
_method
parameter in a random form withPOST
method raises a PHP warning.How to reproduce
Activate HTTP method override
Submit a random form with
POST
method to a URL which contains an array as_method
query parameter (e. g.https://example.com?_method[]=foo&_method[]=bar
).Possible Solution
Request::getMethod()
should check the type of the acquired_method
value and don't use it if it is no string.Additional context
bootstrap.php.cache line 977 is equivalent to src/Symfony/Component/HttpFoundation/Request.php
The text was updated successfully, but these errors were encountered: