From ec46fdc945f591e910051aca0457097825afd34c Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 6 Dec 2005 22:53:07 +0000 Subject: --- framework/TComponent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'framework/TComponent.php') diff --git a/framework/TComponent.php b/framework/TComponent.php index 3934bfdc..c1b483c0 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -538,8 +538,8 @@ class TPropertyValue */ public static function ensureEnum($value,$enum) { - if(($index=array_search($value,$enum))!==false) - return $enum[$index]; + if(in_array($value,$enum)) + return $value; else throw new TInvalidDataValueException('propertyvalue_enumvalue_invalid',$value,implode(' | ',$enum)); } -- cgit v1.2.3