From a6408be566dc9877eb67c86d4283dd57b2255d8b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 24 Jun 2010 15:21:04 +0000 Subject: [PATCH] Regression fix for Recaptcha on SSL registration page; their API is served on a different hostname for SSL. --- plugins/Recaptcha/RecaptchaPlugin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/Recaptcha/RecaptchaPlugin.php b/plugins/Recaptcha/RecaptchaPlugin.php index f09d81ec00..7cc34c5686 100644 --- a/plugins/Recaptcha/RecaptchaPlugin.php +++ b/plugins/Recaptcha/RecaptchaPlugin.php @@ -77,8 +77,11 @@ class RecaptchaPlugin extends Plugin { if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) { // Load the AJAX API - $proto = $this->checkssl() ? 'https' : 'http'; - $url = "$proto://api.recaptcha.net/js/recaptcha_ajax.js"; + if ($this->checkssl()) { + $url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js"; + } else { + $url = "http://api.recaptcha.net/js/recaptcha_ajax.js"; + } $action->script($url); // And when we're ready, fill out the captcha!