]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use library function to determine if https should be used for recaptcha
authorCraig Andrews <candrews@integralblue.com>
Wed, 27 Oct 2010 04:11:55 +0000 (00:11 -0400)
committerCraig Andrews <candrews@integralblue.com>
Wed, 27 Oct 2010 04:11:55 +0000 (00:11 -0400)
plugins/Recaptcha/RecaptchaPlugin.php

index 08557cbd8481b8cb77c77cf6936c2ec3b0828c36..5a33e7132e101faeb83bdd76968f9b894cf5aa66 100644 (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";
@@ -120,4 +111,4 @@ class RecaptchaPlugin extends Plugin
                                'captcha to the registration page.'));
         return true;
     }
-}
\ No newline at end of file
+}