diff options
author | xue <> | 2007-08-30 15:40:24 +0000 |
---|---|---|
committer | xue <> | 2007-08-30 15:40:24 +0000 |
commit | d1875fd32e0aa7a093544b5decd0b43499424d4f (patch) | |
tree | 223c67445e9a204cabf93274061e506889a2090a /framework/Web/Javascripts/source | |
parent | 8a6d62fbe24321bdd83afa118726f2bd14c7dfb3 (diff) |
further enhanced TCaptcha.
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r-- | framework/Web/Javascripts/source/prado/validator/validation3.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js index 3d43a5f3..62d6e718 100644 --- a/framework/Web/Javascripts/source/prado/validator/validation3.js +++ b/framework/Web/Javascripts/source/prado/validator/validation3.js @@ -1388,14 +1388,11 @@ Prado.WebUI.TCaptchaValidator = Class.extend(Prado.WebUI.TBaseValidator, */
evaluateIsValid : function()
{
- var a = this.getValidationValue();
- if (a.length <= 0)
- return false;
- var b = this.options.TokenHash;
- if (this.options.CaseSensitive)
- return(this.crc32(a) == b);
- else
- return(this.crc32(a.toUpperCase()) == b);
+ var a = this.getValidationValue();
+ var h = 0;
+ for(var i = a.length-1; i >= 0; --i)
+ h += a.charCodeAt(i);
+ return h == this.options.TokenHash;
},
crc32 : function(str)
|