mirror of
https://github.com/moodle/moodle.git
synced 2025-05-13 19:56:25 +02:00
MDL-27364 use https for recaptcha when site runs via https
Based on solution by Rajesh Taneja.
This commit is contained in:
parent
42f6b3f1d7
commit
b608b227ba
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user