More nuance to human boolean check

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-11-13 15:15:34 +00:00
parent 6c2cfe0405
commit 6f25ed3c59

View file

@ -492,6 +492,16 @@ abstract class Importer
public function fetchHumanBoolean($value) public function fetchHumanBoolean($value)
{ {
$true = [
'yes',
'y',
'true',
];
if (in_array(strtolower($value), $true)) {
return 1;
}
return (int) filter_var($value, FILTER_VALIDATE_BOOLEAN); return (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);
} }
@ -528,6 +538,7 @@ abstract class Importer
return null; return null;
} }
/** /**
* Fetch an existing manager * Fetch an existing manager
* *