mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-48023 Files API: Theme files must be cache-able by shared proxies.
The profile image AKA user icon will be cache-able by shared proxies too, under its specific accessibility constraints/conditions.
This commit is contained in:
parent
c106341098
commit
bb8ed60a3c
4 changed files with 37 additions and 9 deletions
|
@ -88,6 +88,10 @@ function theme_clean_set_logo($css, $logo) {
|
|||
function theme_clean_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM and $filearea === 'logo') {
|
||||
$theme = theme_config::load('clean');
|
||||
// By default, theme files must be cache-able by both browsers and proxies.
|
||||
if (!array_key_exists('cacheability', $options)) {
|
||||
$options['cacheability'] = 'public';
|
||||
}
|
||||
return $theme->setting_file_serve('logo', $args, $forcedownload, $options);
|
||||
} else {
|
||||
send_file_not_found();
|
||||
|
|
|
@ -149,6 +149,10 @@ function theme_more_set_logo($css, $logo) {
|
|||
function theme_more_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM && ($filearea === 'logo' || $filearea === 'backgroundimage')) {
|
||||
$theme = theme_config::load('more');
|
||||
// By default, theme files must be cache-able by both browsers and proxies.
|
||||
if (!array_key_exists('cacheability', $options)) {
|
||||
$options['cacheability'] = 'public';
|
||||
}
|
||||
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
|
||||
} else {
|
||||
send_file_not_found();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue