forked from GithubBackups/vichan
urlencode reCAPTCHA response for safety
This commit is contained in:
parent
1ad9f49694
commit
18aed77ecc
5
post.php
5
post.php
@ -385,10 +385,11 @@ if (isset($_POST['delete'])) {
|
|||||||
if ($config['recaptcha']) {
|
if ($config['recaptcha']) {
|
||||||
if (!isset($_POST['g-recaptcha-response']))
|
if (!isset($_POST['g-recaptcha-response']))
|
||||||
error($config['error']['bot']);
|
error($config['error']['bot']);
|
||||||
// Check what reCAPTCHA has to say...
|
|
||||||
|
// Check what reCAPTCHA has to say...
|
||||||
$resp = json_decode(file_get_contents(sprintf('https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s',
|
$resp = json_decode(file_get_contents(sprintf('https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s',
|
||||||
$config['recaptcha_private'],
|
$config['recaptcha_private'],
|
||||||
$_POST['g-recaptcha-response'],
|
urlencode($_POST['g-recaptcha-response']),
|
||||||
$_SERVER['REMOTE_ADDR'])), true);
|
$_SERVER['REMOTE_ADDR'])), true);
|
||||||
|
|
||||||
if (!$resp['success']) {
|
if (!$resp['success']) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user