forked from GithubBackups/vichan
Fix crash if no captcha is enabled
This commit is contained in:
parent
3016d69428
commit
650ef8bcc2
2
post.php
2
post.php
@ -627,11 +627,13 @@ if (isset($_POST['delete'])) {
|
||||
$query = RemoteCaptchaQuery::withHCaptcha($context->getHttpDriver(), $config['hcaptcha_private']);
|
||||
}
|
||||
|
||||
if (isset($query, $response)) {
|
||||
$success = $query->verify($response, $_SERVER['REMOTE_ADDR']);
|
||||
if (!$success) {
|
||||
error($config['error']['captcha']);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException $e) {
|
||||
if ($config['syslog']) {
|
||||
_syslog(LOG_ERR, "Captcha IO exception: {$e->getMessage()}");
|
||||
|
Loading…
x
Reference in New Issue
Block a user