use library function to determine if https should be used for recaptcha

This commit is contained in:
Craig Andrews 2010-10-27 00:11:55 -04:00
parent 9f9126e524
commit 255ba42ef1

View File

@ -51,15 +51,6 @@ class RecaptchaPlugin extends Plugin
}
}
function checkssl()
{
if(common_config('site', 'ssl') === 'sometimes' || common_config('site', 'ssl') === 'always') {
return true;
}
return false;
}
function onEndRegistrationFormData($action)
{
$action->elementStart('li');
@ -79,7 +70,7 @@ class RecaptchaPlugin extends Plugin
{
if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) {
// Load the AJAX API
if ($this->checkssl()) {
if (StatusNet::isHTTPS()) {
$url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js";
} else {
$url = "http://api.recaptcha.net/js/recaptcha_ajax.js";