From 1e8eb9fe0813620a4d90442c439524468f023f26 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Sun, 29 Dec 2013 18:30:08 +0000 Subject: [PATCH] Adding proper SSL checking, maybe? --- public/recaptchalib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;