diff --git a/public/recaptchalib.php b/public/recaptchalib.php index e658a2e..c8c3685 100644 --- a/public/recaptchalib.php +++ b/public/recaptchalib.php @@ -108,7 +108,8 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); } - if ($use_ssl) { + if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' + || $_SERVER['SERVER_PORT'] == 443) { $server = RECAPTCHA_API_SECURE_SERVER; } else { $server = RECAPTCHA_API_SERVER;