Add some more truth states to test
This commit is contained in:
@@ -10,12 +10,18 @@ if(!function_exists('get_truth_state')) {
|
|||||||
function get_truth_state($state)
|
function get_truth_state($state)
|
||||||
{
|
{
|
||||||
$enabledStates = [
|
$enabledStates = [
|
||||||
|
'yes',
|
||||||
|
'y',
|
||||||
'on',
|
'on',
|
||||||
'true',
|
'true',
|
||||||
'1',
|
'1',
|
||||||
true,
|
true,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(is_string($state)) {
|
||||||
|
$state = strtolower($state);
|
||||||
|
}
|
||||||
|
|
||||||
return \in_array($state, $enabledStates, false);
|
return \in_array($state, $enabledStates, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user