From 280727408fe0e8a77c4ae3964397a3789efca927 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 29 May 2013 22:23:44 +0200 Subject: [PATCH] fixed wrong usage of $.inArray in validators fixes #448 --- framework/yii/assets/yii.validation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/assets/yii.validation.js b/framework/yii/assets/yii.validation.js index 2748a74..015040e 100644 --- a/framework/yii/assets/yii.validation.js +++ b/framework/yii/assets/yii.validation.js @@ -87,8 +87,8 @@ yii.validation = (function ($) { if (options.skipOnEmpty && isEmpty(value)) { return; } - var valid = !options.not && $.inArray(value, options.range) - || options.not && !$.inArray(value, options.range); + var valid = !options.not && $.inArray(value, options.range) > -1 + || options.not && $.inArray(value, options.range) == -1; if (!valid) { messages.push(options.message);