From 6f25ed3c59cafbf8f8bff94f65759ef34fbd5d2e Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 13 Nov 2024 15:15:34 +0000 Subject: [PATCH] More nuance to human boolean check Signed-off-by: snipe --- app/Importer/Importer.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Importer/Importer.php b/app/Importer/Importer.php index 6f2816c7af..0316de04f1 100644 --- a/app/Importer/Importer.php +++ b/app/Importer/Importer.php @@ -492,6 +492,16 @@ abstract class Importer public function fetchHumanBoolean($value) { + $true = [ + 'yes', + 'y', + 'true', + ]; + + if (in_array(strtolower($value), $true)) { + return 1; + } + return (int) filter_var($value, FILTER_VALIDATE_BOOLEAN); } @@ -528,6 +538,7 @@ abstract class Importer return null; } + /** * Fetch an existing manager *