summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/WebControls/TReCaptcha.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TReCaptcha.php b/framework/Web/UI/WebControls/TReCaptcha.php
index 50886276..b9ba0070 100644
--- a/framework/Web/UI/WebControls/TReCaptcha.php
+++ b/framework/Web/UI/WebControls/TReCaptcha.php
@@ -159,11 +159,20 @@ class TReCaptcha extends TWebControl implements IValidatable
public function validate()
{
+ if (!
+ (
+ ($challenge = @$_POST[$this->getChallengeFieldName()])
+ and
+ ($response = @$_POST[$this->getResponseFieldName()])
+ )
+ )
+ return false;
+
$resp = recaptcha_check_answer(
$this->getPrivateKey(),
$_SERVER["REMOTE_ADDR"],
- $_POST[$this->getChallengeFieldName()],
- $_POST[$this->getResponseFieldName()]
+ $challenge,
+ $response
);
return ($resp->is_valid==1);
}