浏览代码

#401: stringLength validator allows spaces after max length

phuoc 11 年之前
父节点
当前提交
3681075ce3
共有 4 个文件被更改,包括 6 次插入5 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 1
      dist/js/bootstrapValidator.js
  3. 3 3
      dist/js/bootstrapValidator.min.js
  4. 1 1
      src/js/validator/stringLength.js

+ 1 - 0
CHANGELOG.md

@@ -55,6 +55,7 @@ __Bug Fixes__
 * [#358](https://github.com/nghuuphuoc/bootstrapvalidator/issues/358): The [```zipCode``` validator](http://bootstrapvalidator.com/validators/zipCode/) doesn't work for Canadian zip code
 * [#377](https://github.com/nghuuphuoc/bootstrapvalidator/issues/377): The [id](http://bootstrapvalidator.com/validators/id/), [vat](http://bootstrapvalidator.com/validators/vat/) validators should return ```false``` if the country code is not supported
 * [#389](https://github.com/nghuuphuoc/bootstrapvalidator/issues/389): When using multiple forms with HTML attributes on the same page, the plugin options will be the same as the last one
+* [#401](https://github.com/nghuuphuoc/bootstrapvalidator/issues/401): [stringLength validator](http://bootstrapvalidator.com/validators/stringLength/) allows spaces after max length
 
 __Document__
 * [#259](https://github.com/nghuuphuoc/bootstrapvalidator/issues/259): Typo "Support almost Bootstrap forms", thanks to [@lloydde](https://github.com/lloydde)

+ 1 - 1
dist/js/bootstrapValidator.js

@@ -4507,7 +4507,7 @@
                 return true;
             }
 
-            var length = $.trim(value).length;
+            var length = value.length;
             if ((options.min && length < options.min) || (options.max && length > options.max)) {
                 return false;
             }

文件差异内容过多而无法显示
+ 3 - 3
dist/js/bootstrapValidator.min.js


+ 1 - 1
src/js/validator/stringLength.js

@@ -56,7 +56,7 @@
                 return true;
             }
 
-            var length = $.trim(value).length;
+            var length = value.length;
             if ((options.min && length < options.min) || (options.max && length > options.max)) {
                 return false;
             }