diff --git a/src/bb-modules/Spamchecker/Service.php b/src/bb-modules/Spamchecker/Service.php
index c732021d2..136ab0776 100644
--- a/src/bb-modules/Spamchecker/Service.php
+++ b/src/bb-modules/Spamchecker/Service.php
@@ -148,11 +148,11 @@ class Service implements InjectionAwareInterface
if (isset($config['captcha_version']) && $config['captcha_version'] == 2) {
if (!isset($config['captcha_recaptcha_privatekey']) || $config['captcha_recaptcha_privatekey'] == '') {
- throw new \Box_Exception("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create");
+ throw new \Box_Exception("To use reCAPTCHA you must get an API key from here");
}
if (!isset($params['g-recaptcha-response']) || $params['g-recaptcha-response'] == '') {
- throw new \Box_Exception("No response received");
+ throw new \Box_Exception("You have to complete the CAPTCHA to continue");
}
$postData = array(
@@ -164,31 +164,15 @@ class Service implements InjectionAwareInterface
$options = [
'form_params' => $postData
];
- $response = $di['guzzle_client']->request('POST', 'https://www.google.com/recaptcha/api/siteverify', $options);
+ $response = $di['guzzle_client']->request('POST', 'https://google.com/recaptcha/api/siteverify', $options);
$body = $response->getBody()->getContents();
$content = json_decode($body, true);
if (!$content['success']) {
- throw new \Box_Exception('Captcha verification failed.');
+ throw new \Box_Exception('reCAPTCHA verification failed.');
}
-
} else {
-
- $privatekey = $config['captcha_recaptcha_privatekey'];
-
- if ($privatekey == null || $privatekey == '') {
- throw new \Box_Exception("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create");
- }
-
- require_once BB_PATH_MODS . '/Spamchecker/recaptchalib.php';
- $resp = recaptcha_check_answer($privatekey,
- $data['ip'],
- $data["recaptcha_challenge_field"],
- $data["recaptcha_response_field"]);
- if (!$resp->is_valid) {
- error_log($resp->error);
- throw new \Box_Exception('Captcha verification failed.');
- }
+ throw new \Box_Exception('reCAPTCHA verification failed.');
}
}
@@ -211,7 +195,7 @@ class Service implements InjectionAwareInterface
public function isInStopForumSpamDatabase(array $data)
{
$data['f'] = 'json';
- $url = 'http://www.stopforumspam.com/api?'.http_build_query($data);
+ $url = 'https://www.stopforumspam.com/api?'.http_build_query($data);
$file_contents = $this->di['tools']->file_get_contents($url);
$json = json_decode($file_contents);
@@ -220,15 +204,15 @@ class Service implements InjectionAwareInterface
}
if(isset($json->username->appears) && $json->username->appears) {
- throw new \Box_Exception('Your Username is blacklisted in global database');
+ throw new \Box_Exception('Your username is blacklisted in the Stop Forum Spam database');
}
if(isset($json->email->appears) && $json->email->appears) {
- throw new \Box_Exception('Your Email is blacklisted in global database');
+ throw new \Box_Exception('Your e-mail is blacklisted in the Stop Forum Spam database');
}
if(isset($json->ip->appears) && $json->ip->appears) {
- throw new \Box_Exception('Your IP is blacklisted in global database');
+ throw new \Box_Exception('Your IP address is blacklisted in the Stop Forum Spam database');
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/bb-modules/Spamchecker/html_admin/mod_spamchecker_settings.phtml b/src/bb-modules/Spamchecker/html_admin/mod_spamchecker_settings.phtml
index 2056847f6..21c8875c4 100644
--- a/src/bb-modules/Spamchecker/html_admin/mod_spamchecker_settings.phtml
+++ b/src/bb-modules/Spamchecker/html_admin/mod_spamchecker_settings.phtml
@@ -42,14 +42,14 @@
-
{% trans 'Recaptcha settings' %}
-
{% trans 'Enable captcha for client registration and contact us forms' %}