mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
Fixed booleanization bug.
This commit is contained in:
@@ -286,9 +286,9 @@ class Config_File extends PEAR {
|
|||||||
return new Config_File_Error("Bad variable name '$var_name'");
|
return new Config_File_Error("Bad variable name '$var_name'");
|
||||||
|
|
||||||
if ($booleanize) {
|
if ($booleanize) {
|
||||||
if (preg_match("/^on|true|yes$/", $var_value))
|
if (preg_match("/^(on|true|yes)$/", $var_value))
|
||||||
$var_value = true;
|
$var_value = true;
|
||||||
else if (preg_match("/^off|false|no$/", $var_value))
|
else if (preg_match("/^(off|false|no)$/", $var_value))
|
||||||
$var_value = false;
|
$var_value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
NEWS
9
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 regex_replace modifier, documented. (Monte)
|
||||||
- added debugging console feature and custom function assign_debug_info,
|
- added debugging console feature and custom function assign_debug_info,
|
||||||
documented. (Monte)
|
documented. (Monte)
|
||||||
- added 'scope' attribute for {config_load}, 'global' is now deprecated but
|
- added 'scope' attribute for {config_load}, 'global' is now deprecated but
|
||||||
is still supported. (Andrei)
|
is still supported. (Andrei)
|
||||||
- reduced template symbol table pollution by moving config array into the
|
- reduced template symbol table pollution by moving config array into the
|
||||||
|
@@ -286,9 +286,9 @@ class Config_File extends PEAR {
|
|||||||
return new Config_File_Error("Bad variable name '$var_name'");
|
return new Config_File_Error("Bad variable name '$var_name'");
|
||||||
|
|
||||||
if ($booleanize) {
|
if ($booleanize) {
|
||||||
if (preg_match("/^on|true|yes$/", $var_value))
|
if (preg_match("/^(on|true|yes)$/", $var_value))
|
||||||
$var_value = true;
|
$var_value = true;
|
||||||
else if (preg_match("/^off|false|no$/", $var_value))
|
else if (preg_match("/^(off|false|no)$/", $var_value))
|
||||||
$var_value = false;
|
$var_value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user