don't crash if recaptcha repsonse is empty
This commit is contained in:
parent
34f75cfb22
commit
6377ea19cc
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ function captcha_check(): bool
|
||||||
$r_privatekey = $config->get_string('api_recaptcha_privkey');
|
$r_privatekey = $config->get_string('api_recaptcha_privkey');
|
||||||
if (!empty($r_privatekey)) {
|
if (!empty($r_privatekey)) {
|
||||||
$recaptcha = new ReCaptcha($r_privatekey);
|
$recaptcha = new ReCaptcha($r_privatekey);
|
||||||
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
|
$resp = $recaptcha->verify($_POST['g-recaptcha-response'] ?? "", $_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if (!$resp->isSuccess()) {
|
if (!$resp->isSuccess()) {
|
||||||
log_info("core", "Captcha failed (ReCaptcha): " . implode("", $resp->getErrorCodes()));
|
log_info("core", "Captcha failed (ReCaptcha): " . implode("", $resp->getErrorCodes()));
|
||||||
|
|
Reference in a new issue