Skip to content
Snippets Groups Projects
Commit b7e5410e authored by Rob Loach's avatar Rob Loach
Browse files

Issue #1142150 by Misterw: New HTTPS API reCAPTCHA URL.

parent a1b4c552
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ function recaptcha_admin_settings() { ...@@ -72,7 +72,7 @@ function recaptcha_admin_settings() {
'#title' => t('Public Key'), '#title' => t('Public Key'),
'#default_value' => variable_get('recaptcha_public_key', ''), '#default_value' => variable_get('recaptcha_public_key', ''),
'#maxlength' => 40, '#maxlength' => 40,
'#description' => t('The public key given to you when you <a href="@url" target="_blank">registered at reCAPTCHA.net</a>.', array('@url' => url(recaptcha_get_signup_url($_SERVER['SERVER_NAME'], variable_get('site_name', ''))))), '#description' => t('The public key given to you when you <a href="@url" target="_blank">registered at google.com</a>.', array('@url' => url(recaptcha_get_signup_url($_SERVER['SERVER_NAME'], variable_get('site_name', ''))))),
'#required' => TRUE, '#required' => TRUE,
); );
$form['recaptcha_private_key'] = array( $form['recaptcha_private_key'] = array(
...@@ -80,7 +80,7 @@ function recaptcha_admin_settings() { ...@@ -80,7 +80,7 @@ function recaptcha_admin_settings() {
'#title' => t('Private Key'), '#title' => t('Private Key'),
'#default_value' => variable_get('recaptcha_private_key', ''), '#default_value' => variable_get('recaptcha_private_key', ''),
'#maxlength' => 40, '#maxlength' => 40,
'#description' => t('The private key given to you when you <a href="@url" target="_blank">registered at reCAPTCHA.net</a>.', array('@url' => url(recaptcha_get_signup_url($_SERVER['SERVER_NAME'], variable_get('site_name', ''))))), '#description' => t('The private key given to you when you <a href="@url" target="_blank">registered at google.com</a>.', array('@url' => url(recaptcha_get_signup_url($_SERVER['SERVER_NAME'], variable_get('site_name', ''))))),
'#required' => TRUE, '#required' => TRUE,
); );
$form['recaptcha_secure_connection'] = array( $form['recaptcha_secure_connection'] = array(
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* - Documentation and latest version * - Documentation and latest version
* http://recaptcha.net/plugins/php/ * http://recaptcha.net/plugins/php/
* - Get a reCAPTCHA API Key * - Get a reCAPTCHA API Key
* http://recaptcha.net/api/getkey * https://www.google.com/recaptcha/admin/create
* - Discussion group * - Discussion group
* http://groups.google.com/group/recaptcha * http://groups.google.com/group/recaptcha
* *
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
/** /**
* The reCAPTCHA server URL's * The reCAPTCHA server URL's
*/ */
define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net"); define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net"); define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net"); define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
/** /**
* Encodes the given data into a query string format * Encodes the given data into a query string format
...@@ -106,7 +106,7 @@ function _recaptcha_http_post($host, $path, $data, $port = 80) { ...@@ -106,7 +106,7 @@ function _recaptcha_http_post($host, $path, $data, $port = 80) {
function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
{ {
if ($pubkey == null || $pubkey == '') { if ($pubkey == null || $pubkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>"); die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
} }
if ($use_ssl) { if ($use_ssl) {
...@@ -152,7 +152,7 @@ class ReCaptchaResponse { ...@@ -152,7 +152,7 @@ class ReCaptchaResponse {
function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array()) function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
{ {
if ($privkey == null || $privkey == '') { if ($privkey == null || $privkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>"); die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
} }
if ($remoteip == null || $remoteip == '') { if ($remoteip == null || $remoteip == '') {
...@@ -169,7 +169,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex ...@@ -169,7 +169,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex
return $recaptcha_response; return $recaptcha_response;
} }
$response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify", $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
array ( array (
'privatekey' => $privkey, 'privatekey' => $privkey,
'remoteip' => $remoteip, 'remoteip' => $remoteip,
...@@ -200,7 +200,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex ...@@ -200,7 +200,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex
* @param string $appname The name of your application * @param string $appname The name of your application
*/ */
function recaptcha_get_signup_url ($domain = null, $appname = null) { function recaptcha_get_signup_url ($domain = null, $appname = null) {
return "http://recaptcha.net/api/getkey?" . _recaptcha_qsencode (array ('domain' => $domain, 'app' => $appname)); return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
} }
function _recaptcha_aes_pad($val) { function _recaptcha_aes_pad($val) {
...@@ -230,14 +230,14 @@ function _recaptcha_mailhide_urlbase64 ($x) { ...@@ -230,14 +230,14 @@ function _recaptcha_mailhide_urlbase64 ($x) {
function recaptcha_mailhide_url($pubkey, $privkey, $email) { function recaptcha_mailhide_url($pubkey, $privkey, $email) {
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) { if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
"you can do so at <a href='http://mailhide.recaptcha.net/apikey'>http://mailhide.recaptcha.net/apikey</a>"); "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
} }
$ky = pack('H*', $privkey); $ky = pack('H*', $privkey);
$cryptmail = _recaptcha_aes_encrypt ($email, $ky); $cryptmail = _recaptcha_aes_encrypt ($email, $ky);
return "http://mailhide.recaptcha.net/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
} }
/** /**
...@@ -262,7 +262,7 @@ function _recaptcha_mailhide_email_parts ($email) { ...@@ -262,7 +262,7 @@ function _recaptcha_mailhide_email_parts ($email) {
* Gets html to display an email address given a public an private key. * Gets html to display an email address given a public an private key.
* to get a key, go to: * to get a key, go to:
* *
* http://mailhide.recaptcha.net/apikey * http://www.google.com/recaptcha/mailhide/apikey
*/ */
function recaptcha_mailhide_html($pubkey, $privkey, $email) { function recaptcha_mailhide_html($pubkey, $privkey, $email) {
$emailparts = _recaptcha_mailhide_email_parts ($email); $emailparts = _recaptcha_mailhide_email_parts ($email);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment