Skip to content
Browse files

MDL-27364 use https for recaptcha when site runs via https

Based on solution by Rajesh Taneja.
  • Loading branch information...
1 parent f844dbc commit c3056feed85bf7ea11c829e8756f521e50580abb @skodak skodak committed with nebgor Dec 6, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/form/recaptcha.php
View
7 lib/form/recaptcha.php
@@ -33,10 +33,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;
}
}

0 comments on commit c3056fe

Please sign in to comment.
Something went wrong with that request. Please try again.