From 83fd64cf51f6f37c835e796e3658f604757b0e45 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Sat, 2 Nov 2024 17:33:18 +0200 Subject: [PATCH] Fixes boolean fields --- app/classes/config.php | 6 +++--- app/helpers/render.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/classes/config.php b/app/classes/config.php index 850f119..2eff28e 100644 --- a/app/classes/config.php +++ b/app/classes/config.php @@ -17,10 +17,10 @@ class Config { // value is without quotes, because it could be true/false $pattern = "/(['\"]{$key}['\"]\s*=>\s*)([^,]+),/"; - // prepare the value, treating booleans as 'true' or 'false' - if ($newValue === 1) { + // prepare the value, make booleans w/out single quotes + if ($newValue === 'true') { $replacementValue = 'true'; - } elseif ($newValue === 0) { + } elseif ($newValue === 'false') { $replacementValue = 'false'; } else { $replacementValue = var_export($newValue, true); diff --git a/app/helpers/render.php b/app/helpers/render.php index a909fc6..d82a7b5 100644 --- a/app/helpers/render.php +++ b/app/helpers/render.php @@ -57,8 +57,8 @@ function editConfig($configPart, $indent, $platform=false, $parent='') { ?>
- - /> + + />