mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Fix fatal error when unable to connecto to reCAPTCHA server
This commit is contained in:
parent
b2d9a43bc9
commit
c8c033de66
3 changed files with 14 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
$lang->msg_recaptcha_connection_error = 'An error occurred while connecting to the reCAPTCHA verification server.';
|
||||||
$lang->msg_recaptcha_server_error = 'An error occurred while verifying your reCAPTCHA response.';
|
$lang->msg_recaptcha_server_error = 'An error occurred while verifying your reCAPTCHA response.';
|
||||||
$lang->msg_recaptcha_invalid_response = 'Please check reCAPTCHA.';
|
$lang->msg_recaptcha_invalid_response = 'Please check reCAPTCHA.';
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
$lang->msg_recaptcha_connection_error = 'reCAPTCHA 스팸방지 서버에 접속하는 도중 오류가 발생했습니다.';
|
||||||
$lang->msg_recaptcha_server_error = 'reCAPTCHA 스팸방지 서버와 통신하는 도중 오류가 발생했습니다.';
|
$lang->msg_recaptcha_server_error = 'reCAPTCHA 스팸방지 서버와 통신하는 도중 오류가 발생했습니다.';
|
||||||
$lang->msg_recaptcha_invalid_response = 'reCAPTCHA 스팸방지 기능을 체크해 주십시오.';
|
$lang->msg_recaptcha_invalid_response = 'reCAPTCHA 스팸방지 기능을 체크해 주십시오.';
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,18 @@ class reCAPTCHA
|
||||||
return new Object(-1, lang('recaptcha.msg_recaptcha_invalid_response'));
|
return new Object(-1, lang('recaptcha.msg_recaptcha_invalid_response'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$verify_request = \Requests::post(self::$verify, array(), array(
|
try
|
||||||
'secret' => self::$config->secret_key,
|
{
|
||||||
'response' => $response,
|
$verify_request = \Requests::post(self::$verify, array(), array(
|
||||||
'remoteip' => \RX_CLIENT_IP,
|
'secret' => self::$config->secret_key,
|
||||||
));
|
'response' => $response,
|
||||||
|
'remoteip' => \RX_CLIENT_IP,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
catch (\Requests_Exception $e)
|
||||||
|
{
|
||||||
|
return new Object(-1, lang('recaptcha.msg_recaptcha_connection_error'));
|
||||||
|
}
|
||||||
|
|
||||||
$verify = @json_decode($verify_request->body, true);
|
$verify = @json_decode($verify_request->body, true);
|
||||||
if ($verify && isset($verify['error-codes']) && in_array('invalid-input-response', $verify['error-codes']))
|
if ($verify && isset($verify['error-codes']) && in_array('invalid-input-response', $verify['error-codes']))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue