summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js13
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)