ソースを参照

#401: stringLength validator allows spaces after max length

phuoc 11 年 前
コミット
3681075ce3

+ 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;
             }