* @return moodle_url
*/
public function get_url(moodle_page $page, renderer_base $renderer = null) {
- global $CFG, $FULLME;
+ global $CFG;
if (is_null($renderer)) {
$renderer = $page->get_renderer('core');
// Build a gravatar URL with what we know.
// If the currently requested page is https then we'll return an
// https gravatar page.
- if (strpos($FULLME, 'https://') === 0) {
+ if (strpos($CFG->httpswwwroot, 'https:') === 0) {
$imageurl = new moodle_url("https://secure.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $imageurl->out(false)));
} else {
$imageurl = new moodle_url("http://www.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $imageurl->out(false)));
}
// now the real test and redirect!
+ // NOTE: do NOT use this test for detection of https on current page because this code is not compatible with SSL proxies,
+ // instead use strpos($CFG->httpswwwroot, 'https:') === 0
if (strpos($FULLME, 'https:') !== 0) {
// this may lead to infinite redirect on misconfigured sites, in that case use $CFG->loginhttps=0; in /config.php
redirect($this->_url);
/**
* Full script path including all params, slash arguments, scheme and host.
+ *
+ * Note: Do NOT use for getting of current page URL or detection of https,
+ * instead use $PAGE->url or strpos($CFG->httpswwwroot, 'https:') === 0
+ *
* @global string $FULLME
* @name $FULLME
*/
}
function lti_request_is_using_ssl() {
- global $FULLME;
- return (stripos($FULLME, 'https://') === 0);
+ global $CFG;
+ return (stripos($CFG->httpswwwroot, 'https://') === 0);
}
function lti_ensure_url_is_https($url) {