diff --git a/lib/form/recaptcha.php b/lib/form/recaptcha.php index 79b2cb1f9b1..0282efdf0d4 100644 --- a/lib/form/recaptcha.php +++ b/lib/form/recaptcha.php @@ -34,10 +34,13 @@ class MoodleQuickForm_recaptcha extends HTML_QuickForm_input { * */ 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; } }