use library function to determine if https should be used for recaptcha
This commit is contained in:
parent
9f9126e524
commit
255ba42ef1
@ -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)
|
function onEndRegistrationFormData($action)
|
||||||
{
|
{
|
||||||
$action->elementStart('li');
|
$action->elementStart('li');
|
||||||
@ -79,7 +70,7 @@ class RecaptchaPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) {
|
if (isset($action->recaptchaPluginNeedsOutput) && $action->recaptchaPluginNeedsOutput) {
|
||||||
// Load the AJAX API
|
// Load the AJAX API
|
||||||
if ($this->checkssl()) {
|
if (StatusNet::isHTTPS()) {
|
||||||
$url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js";
|
$url = "https://api-secure.recaptcha.net/js/recaptcha_ajax.js";
|
||||||
} else {
|
} else {
|
||||||
$url = "http://api.recaptcha.net/js/recaptcha_ajax.js";
|
$url = "http://api.recaptcha.net/js/recaptcha_ajax.js";
|
||||||
|
Loading…
Reference in New Issue
Block a user