Skip to content

Commit

Permalink
Add protected function reCaptchaIsHuman
Browse files Browse the repository at this point in the history
  • Loading branch information
hungnguyenhp committed Mar 27, 2024
1 parent 22f0ff5 commit c360428
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 @@ -515,5 +515,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 @@ -514,5 +514,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 c360428

Please sign in to comment.