Skip to content

Commit

Permalink
MDL-27364 use https for recaptcha when site runs via https
Browse files Browse the repository at this point in the history
Based on solution by Rajesh Taneja.
  • Loading branch information
skodak authored and Aparup Banerjee committed Dec 9, 2011
1 parent c4a91d0 commit 2876f41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/form/recaptcha.php
Expand Up @@ -34,10 +34,13 @@ class MoodleQuickForm_recaptcha extends HTML_QuickForm_input {
* </code> * </code>
*/ */
function MoodleQuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) { function MoodleQuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) {
global $CFG;
parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes); parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->_type = 'recaptcha'; $this->_type = 'recaptcha';
if (!empty($attributes['https'])) { if (!empty($attributes['https']) or strpos($CFG->httpswwwroot, 'https:') === 0) {
$this->_https = $attributes['https']; $this->_https = true;
} else {
$this->_https = false;
} }
} }


Expand Down

0 comments on commit 2876f41

Please sign in to comment.