Skip to content

Commit

Permalink
fix for #981
Browse files Browse the repository at this point in the history
  • Loading branch information
mevdschee committed Jul 20, 2023
1 parent 30a0712 commit 3ec4c16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api.include.php
Expand Up @@ -6018,7 +6018,7 @@ private function convertInputValue($conversion, $value)
{
switch ($conversion) {
case 'boolean':
return $value ? 1 : 0;
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
case 'base64url_to_base64':
return str_pad(strtr($value, '-_', '+/'), ceil(strlen($value) / 4) * 4, '=', STR_PAD_RIGHT);
}
Expand Down
2 changes: 1 addition & 1 deletion api.php
Expand Up @@ -6018,7 +6018,7 @@ private function convertInputValue($conversion, $value)
{
switch ($conversion) {
case 'boolean':
return $value ? 1 : 0;
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
case 'base64url_to_base64':
return str_pad(strtr($value, '-_', '+/'), ceil(strlen($value) / 4) * 4, '=', STR_PAD_RIGHT);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tqdev/PhpCrudApi/Database/DataConverter.php
Expand Up @@ -69,7 +69,7 @@ private function convertInputValue($conversion, $value)
{
switch ($conversion) {
case 'boolean':
return $value ? 1 : 0;
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
case 'base64url_to_base64':
return str_pad(strtr($value, '-_', '+/'), ceil(strlen($value) / 4) * 4, '=', STR_PAD_RIGHT);
}
Expand Down

0 comments on commit 3ec4c16

Please sign in to comment.