From d4765fcab15b6173e4a6e02144c78a64b7605119 Mon Sep 17 00:00:00 2001 From: andrey Date: Thu, 21 Jun 2001 21:48:03 +0000 Subject: [PATCH] Fixed booleanization bug. --- Config_File.class.php | 4 ++-- NEWS | 9 +++++++-- libs/Config_File.class.php | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Config_File.class.php b/Config_File.class.php index 9a56f66e..b6784f1b 100644 --- a/Config_File.class.php +++ b/Config_File.class.php @@ -286,9 +286,9 @@ class Config_File extends PEAR { return new Config_File_Error("Bad variable name '$var_name'"); if ($booleanize) { - if (preg_match("/^on|true|yes$/", $var_value)) + if (preg_match("/^(on|true|yes)$/", $var_value)) $var_value = true; - else if (preg_match("/^off|false|no$/", $var_value)) + else if (preg_match("/^(off|false|no)$/", $var_value)) $var_value = false; } diff --git a/NEWS b/NEWS index de5f1743..46b72ca8 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ + - fixed a bug in Config_File that would incorrectly booleanize values that + weren't really booleans. (Andrei) + +Version 1.4.3 +------------- - added regex_replace modifier, documented. (Monte) - - added debugging console feature and custom function assign_debug_info, - documented. (Monte) + - added debugging console feature and custom function assign_debug_info, + documented. (Monte) - added 'scope' attribute for {config_load}, 'global' is now deprecated but is still supported. (Andrei) - reduced template symbol table pollution by moving config array into the diff --git a/libs/Config_File.class.php b/libs/Config_File.class.php index 9a56f66e..b6784f1b 100644 --- a/libs/Config_File.class.php +++ b/libs/Config_File.class.php @@ -286,9 +286,9 @@ class Config_File extends PEAR { return new Config_File_Error("Bad variable name '$var_name'"); if ($booleanize) { - if (preg_match("/^on|true|yes$/", $var_value)) + if (preg_match("/^(on|true|yes)$/", $var_value)) $var_value = true; - else if (preg_match("/^off|false|no$/", $var_value)) + else if (preg_match("/^(off|false|no)$/", $var_value)) $var_value = false; }