Skip to content

Commit

Permalink
Merge pull request #46 from nguyenanhung/v3.2.0-develop
Browse files Browse the repository at this point in the history
Add protected function reCaptchaIsHuman
  • Loading branch information
nguyenanhung committed Mar 27, 2024
2 parents 4698751 + 0726588 commit edc3b79
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hungng/HungNG_CI_Base_Controllers.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,5 +517,19 @@ protected function command_clean_cache_apc()
show_404();
}
}

/**
* Check is human by recaptcha from request
*
* @return bool
*/
protected function reCaptchaIsHuman()
{
$captcha = $this->input->post('g-recaptcha-response', true);
if (!$captcha) {
return false;
}
return true;
}
}
}
14 changes: 14 additions & 0 deletions hungng/HungNG_CI_Base_Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,5 +517,19 @@ protected function command_clean_cache_apc()
show_404();
}
}

/**
* Check is human by recaptcha from request
*
* @return bool
*/
protected function reCaptchaIsHuman()
{
$captcha = $this->input->post('g-recaptcha-response', true);
if (!$captcha) {
return false;
}
return true;
}
}
}

0 comments on commit edc3b79

Please sign in to comment.