Merge branch 'w50_MDL-27364_m23_recaptchahttps' of git://github.com/skodak/moodle
authorAparup Banerjee <aparup@moodle.com>
Fri, 9 Dec 2011 03:07:20 +0000 (11:07 +0800)
committerAparup Banerjee <aparup@moodle.com>
Fri, 9 Dec 2011 03:07:20 +0000 (11:07 +0800)
lib/form/recaptcha.php

index 79b2cb1..0282efd 100644 (file)
@@ -34,10 +34,13 @@ class MoodleQuickForm_recaptcha extends HTML_QuickForm_input {
      * </code>
      */
     function MoodleQuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) {
+        global $CFG;
         parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
         $this->_type = 'recaptcha';
-        if (!empty($attributes['https'])) {
-            $this->_https = $attributes['https'];
+        if (!empty($attributes['https']) or strpos($CFG->httpswwwroot, 'https:') === 0) {
+            $this->_https = true;
+        } else {
+            $this->_https = false;
         }
     }