mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-15800: clean filelib.php, fix https image link into the edit profil page (weblib.php), merged from 19
This commit is contained in:
parent
16baeef69c
commit
f86eb734ee
2 changed files with 13 additions and 8 deletions
|
@ -9,7 +9,7 @@ require_once("$CFG->libdir/file/file_browser.php");
|
|||
require_once("$CFG->libdir/packer/zip_packer.php");
|
||||
|
||||
function get_file_url($path, $options=null, $type='coursefile') {
|
||||
global $CFG;
|
||||
global $CFG, $HTTPSPAGEREQUIRED;
|
||||
|
||||
$path = str_replace('//', '/', $path);
|
||||
$path = trim($path, '/'); // no leading and trailing slashes
|
||||
|
@ -23,7 +23,13 @@ function get_file_url($path, $options=null, $type='coursefile') {
|
|||
$url = $CFG->wwwroot."/rss/file.php";
|
||||
break;
|
||||
case 'user':
|
||||
$url = $CFG->wwwroot."/user/pix.php";
|
||||
if (!empty($HTTPSPAGEREQUIRED)) {
|
||||
$wwwroot = $CFG->httpswwwroot;
|
||||
}
|
||||
else {
|
||||
$wwwroot = $CFG->wwwroot;
|
||||
}
|
||||
$url = $wwwroot."/user/pix.php";
|
||||
break;
|
||||
case 'usergroup':
|
||||
$url = $CFG->wwwroot."/user/pixgroup.php";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue