浏览代码

#411: Fix the ean validator, thanks to @manish-in-java

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

+ 1 - 0
CHANGELOG.md

@@ -57,6 +57,7 @@ __Bug Fixes__
 * [#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
+* [#411](https://github.com/nghuuphuoc/bootstrapvalidator/pull/411): Fix the [ean validator](http://bootstrapvalidator.com/validators/ean/) when the check digit is zero, thanks to [@manish-in-java](https://github.com/manish-in-java)
 
 __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

@@ -2181,7 +2181,7 @@
             for (var i = 0; i < length - 1; i++) {
                 sum += parseInt(value.charAt(i)) * weight[i % 2];
             }
-            sum = 10 - sum % 10;
+            sum = (10 - sum % 10) % 10;
             return (sum == value.charAt(length - 1));
         }
     };

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