From 63386d118321bbff8af2d8c480b89fe226400d53 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 12 Nov 2005 11:43:41 +0000 Subject: Changed how string is converted to boolean. --- framework/TComponent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'framework') diff --git a/framework/TComponent.php b/framework/TComponent.php index cdf83016..a23204d5 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -437,13 +437,14 @@ class TPropertyValue * Converts a value to boolean type. * Note, string 'true' (case-insensitive) will be converted to true, * string 'false' (case-insensitive) will be converted to false. + * If a string represents a non-zero number, it will be treated as true. * @param mixed the value to be converted. * @return boolean */ public static function ensureBoolean($value) { if (is_string($value)) - return strcasecmp($value,'true')==0; + return strcasecmp($value,'true')==0 || $value!=0; else return (boolean)$value; } -- cgit v1.2.3