Regression fix for Recaptcha on SSL registration page; their API is served on a different hostname for SSL.

This commit is contained in:
Brion Vibber 2010-06-24 15:21:04 +00:00
parent 1eec7f779f
commit a6408be566

View File

@ -77,8 +77,11 @@ class RecaptchaPlugin extends Plugin
{ {
if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) { if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) {
// Load the AJAX API // Load the AJAX API
$proto = $this->checkssl() ? 'https' : 'http'; if ($this->checkssl()) {
$url = "$proto://api.recaptcha.net/js/recaptcha_ajax.js"; $url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js";
} else {
$url = "http://api.recaptcha.net/js/recaptcha_ajax.js";
}
$action->script($url); $action->script($url);
// And when we're ready, fill out the captcha! // And when we're ready, fill out the captcha!