used strcmp instead of complex comparison, code formatting

This commit is contained in:
Alexander Makarov
2013-06-12 22:24:26 +04:00
parent b45c717e40
commit 615dbd9802

View File

@@ -54,13 +54,13 @@ class CRangeValidator extends CValidator
throw new CException(Yii::t('yii','The "range" property must be specified with a list of values.'));
$result = false;
if($this->strict)
$result = in_array($value,$this->range,true);
$result=in_array($value,$this->range,true);
else
{
foreach($this->range as $r)
{
$result = $r === '' || $value === '' ? $r === $value : $r == $value;
if ($result)
$result=(strcmp($r,$value)===0);
if($result)
break;
}
}