Skip to content

Commit 3101729

Browse files
committed
Merge branch 'main' of github.com:mevdschee/php-crud-api
2 parents 8a424fe + 3ec4c16 commit 3101729

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

api.include.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6018,7 +6018,7 @@ private function convertInputValue($conversion, $value)
60186018
{
60196019
switch ($conversion) {
60206020
case 'boolean':
6021-
return $value ? 1 : 0;
6021+
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
60226022
case 'base64url_to_base64':
60236023
return str_pad(strtr($value, '-_', '+/'), ceil(strlen($value) / 4) * 4, '=', STR_PAD_RIGHT);
60246024
}

api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6018,7 +6018,7 @@ private function convertInputValue($conversion, $value)
60186018
{
60196019
switch ($conversion) {
60206020
case 'boolean':
6021-
return $value ? 1 : 0;
6021+
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
60226022
case 'base64url_to_base64':
60236023
return str_pad(strtr($value, '-_', '+/'), ceil(strlen($value) / 4) * 4, '=', STR_PAD_RIGHT);
60246024
}

src/Tqdev/PhpCrudApi/Database/DataConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private function convertInputValue($conversion, $value)
6969
{
7070
switch ($conversion) {
7171
case 'boolean':
72-
return $value ? 1 : 0;
72+
return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
7373
case 'base64url_to_base64':
7474
return str_pad(strtr($value, '-_', '+/'), ceil(strlen($value) / 4) * 4, '=', STR_PAD_RIGHT);
7575
}

0 commit comments

Comments
 (0)