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
1 changed files with 5 additions and 2 deletions

View File

@ -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!