mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'w51_MDL-30613_m22_FULLME' of git://github.com/skodak/moodle into MOODLE_22_STABLE
This commit is contained in:
commit
b750cfde81
4 changed files with 10 additions and 4 deletions
|
@ -270,7 +270,7 @@ class user_picture implements renderable {
|
||||||
* @return moodle_url
|
* @return moodle_url
|
||||||
*/
|
*/
|
||||||
public function get_url(moodle_page $page, renderer_base $renderer = null) {
|
public function get_url(moodle_page $page, renderer_base $renderer = null) {
|
||||||
global $CFG, $FULLME;
|
global $CFG;
|
||||||
|
|
||||||
if (is_null($renderer)) {
|
if (is_null($renderer)) {
|
||||||
$renderer = $page->get_renderer('core');
|
$renderer = $page->get_renderer('core');
|
||||||
|
@ -329,7 +329,7 @@ class user_picture implements renderable {
|
||||||
// Build a gravatar URL with what we know.
|
// Build a gravatar URL with what we know.
|
||||||
// If the currently requested page is https then we'll return an
|
// If the currently requested page is https then we'll return an
|
||||||
// https gravatar page.
|
// 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)));
|
$imageurl = new moodle_url("https://secure.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $imageurl->out(false)));
|
||||||
} else {
|
} else {
|
||||||
$imageurl = new moodle_url("http://www.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $imageurl->out(false)));
|
$imageurl = new moodle_url("http://www.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $imageurl->out(false)));
|
||||||
|
|
|
@ -1185,6 +1185,8 @@ class moodle_page {
|
||||||
}
|
}
|
||||||
|
|
||||||
// now the real test and redirect!
|
// 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) {
|
if (strpos($FULLME, 'https:') !== 0) {
|
||||||
// this may lead to infinite redirect on misconfigured sites, in that case use $CFG->loginhttps=0; in /config.php
|
// this may lead to infinite redirect on misconfigured sites, in that case use $CFG->loginhttps=0; in /config.php
|
||||||
redirect($this->_url);
|
redirect($this->_url);
|
||||||
|
|
|
@ -341,6 +341,10 @@ global $MCACHE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Full script path including all params, slash arguments, scheme and host.
|
* 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
|
* @global string $FULLME
|
||||||
* @name $FULLME
|
* @name $FULLME
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1127,8 +1127,8 @@ function lti_get_launch_container($lti, $toolconfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function lti_request_is_using_ssl() {
|
function lti_request_is_using_ssl() {
|
||||||
global $FULLME;
|
global $CFG;
|
||||||
return (stripos($FULLME, 'https://') === 0);
|
return (stripos($CFG->httpswwwroot, 'https://') === 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function lti_ensure_url_is_https($url) {
|
function lti_ensure_url_is_https($url) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue