summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TCaptchaValidator.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TCaptchaValidator.php')
-rw-r--r--framework/Web/UI/WebControls/TCaptchaValidator.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TCaptchaValidator.php b/framework/Web/UI/WebControls/TCaptchaValidator.php
index 4385bbfe..6d2c8f4c 100644
--- a/framework/Web/UI/WebControls/TCaptchaValidator.php
+++ b/framework/Web/UI/WebControls/TCaptchaValidator.php
@@ -102,16 +102,23 @@ class TCaptchaValidator extends TBaseValidator
$control=$this->findCaptchaControl();
if($control->getCaseSensitive())
{
- $options['TokenHash']=crc32($control->getToken());
+ $options['TokenHash']=$this->generateTokenHash($control->getToken());
$options['CaseSensitive']=true;
}
else
{
- $options['TokenHash']=crc32(strtoupper($control->getToken()));
+ $options['TokenHash']=$this->generateTokenHash(strtoupper($control->getToken()));
$options['CaseSensitive']=false;
}
return $options;
}
+
+ private function generateTokenHash($token)
+ {
+ for($h=0,$i=strlen($token)-1;$i>=0;--$i)
+ $h+=ord($token[$i]);
+ return $h;
+ }
}
?> \ No newline at end of file