diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:45:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:45:00 +0000 |
commit | 260bd89dc5a1b971e9c545ea0822d7b294538cfc (patch) | |
tree | 750aa3e132390af611951c3910067e375f5458f4 /library/Icingadb/Compat/CompatObject.php | |
parent | Adding debian version 1.1.1-1. (diff) | |
download | icingadb-web-260bd89dc5a1b971e9c545ea0822d7b294538cfc.tar.xz icingadb-web-260bd89dc5a1b971e9c545ea0822d7b294538cfc.zip |
Merging upstream version 1.1.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Icingadb/Compat/CompatObject.php')
-rw-r--r-- | library/Icingadb/Compat/CompatObject.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/library/Icingadb/Compat/CompatObject.php b/library/Icingadb/Compat/CompatObject.php index 6a30751..1d9657d 100644 --- a/library/Icingadb/Compat/CompatObject.php +++ b/library/Icingadb/Compat/CompatObject.php @@ -361,13 +361,14 @@ trait CompatObject */ private function getBoolType($value) { - switch ($value) { - case false: - return 0; - case true: - return 1; - case 'sticky': - return 2; + if ($value === 'sticky') { + return 2; } + + if (is_string($value)) { + return null; + } + + return (int) $value; } } |