Skip to content
Browse files

Merge branch 'w51_MDL-30613_m22_FULLME' of git://github.com/skodak/mo…

…odle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 860f7f9 + cbd8609 commit b750cfde8145c23b63d062f5fcdcc0dde1ff89af @nebgor nebgor committed Dec 12, 2011
Showing with 10 additions and 4 deletions.
  1. +2 −2 lib/outputcomponents.php
  2. +2 −0 lib/pagelib.php
  3. +4 −0 lib/setup.php
  4. +2 −2 mod/lti/locallib.php
View
4 lib/outputcomponents.php
@@ -270,7 +270,7 @@ public static function unalias(stdClass $record, array $extrafields=null, $idali
* @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');
@@ -329,7 +329,7 @@ public function get_url(moodle_page $page, renderer_base $renderer = null) {
// 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)));
View
2 lib/pagelib.php
@@ -1185,6 +1185,8 @@ public function verify_https_required() {
}
// 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);
View
4 lib/setup.php
@@ -341,6 +341,10 @@
/**
* 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
*/
View
4 mod/lti/locallib.php
@@ -1127,8 +1127,8 @@ function lti_get_launch_container($lti, $toolconfig) {
}
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) {

0 comments on commit b750cfd

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