mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Make Conduit "www-form-urlencoded" parsing of "true" and "false" case-insensitive
Summary: See PHI1710. Python encodes `True` as `True` (with an uppercase "T") when building URLs. We currently do not accept this as a "truthy" value, but it's reasonable and unambiguous. Accept "True", "TRUE", "tRuE", etc. Test Plan: Made a cURL conduit call with "True" and "tRuE". Before patch: failure to decoded booleans; after patch: successful interpretation of "true" variations. Differential Revision: https://secure.phabricator.com/D21177
This commit is contained in:
parent
b5bed7b0fa
commit
6617005365
1 changed files with 3 additions and 2 deletions
|
@ -129,8 +129,9 @@ abstract class ConduitParameterType extends Phobject {
|
||||||
'true' => true,
|
'true' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$strict && is_string($value) && isset($bool_strings[$value])) {
|
$normal_value = phutil_utf8_strtolower($value);
|
||||||
$value = $bool_strings[$value];
|
if (!$strict && is_string($value) && isset($bool_strings[$normal_value])) {
|
||||||
|
$value = $bool_strings[$normal_value];
|
||||||
} else if (!is_bool($value)) {
|
} else if (!is_bool($value)) {
|
||||||
$this->raiseValidationException(
|
$this->raiseValidationException(
|
||||||
$request,
|
$request,
|
||||||
|
|
Loading…
Reference in a new issue