Fix #18904: Improve Captcha client-side validation

This commit is contained in:
hexkir
2021-09-28 09:55:47 +03:00
committed by GitHub
parent 51db399769
commit f2caf02164
4 changed files with 4 additions and 3 deletions

View File

@ -261,7 +261,7 @@ yii.validation = (function ($) {
hash = hash == null ? options.hash : hash[options.caseSensitive ? 0 : 1];
var v = options.caseSensitive ? value : value.toLowerCase();
for (var i = v.length - 1, h = 0; i >= 0; --i) {
h += v.charCodeAt(i);
h += v.charCodeAt(i) << i;
}
if (h != hash) {
pub.addMessage(messages, options.message, value);