mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-14 17:44:17 -08:00
More nuance to human boolean check
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
6c2cfe0405
commit
6f25ed3c59
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue