Merge branch 'MDL-83350-main' of https://github.com/meirzamoodle/moodle
This commit is contained in:
+2
-2
@@ -2609,8 +2609,8 @@ function send_file($path, $filename, $lifetime = null , $filter=0, $pathisstring
|
||||
header('Cache-Control: private, max-age=10, no-transform');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
|
||||
header('Pragma: ');
|
||||
} else { //normal http - prevent caching at all cost
|
||||
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform');
|
||||
} else { // Normal http - prevent caching at all cost.
|
||||
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform', 'no-store');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
@@ -622,6 +622,8 @@ class repository_filesystem extends repository {
|
||||
$filename = $options['filename'];
|
||||
}
|
||||
$dontdie = ($options && isset($options['dontdie']));
|
||||
// If the file is linked to the original then we should not cache it.
|
||||
$lifetime = 0;
|
||||
send_file($file, $filename, $lifetime , $filter, false, $forcedownload, '', $dontdie);
|
||||
} else {
|
||||
send_file_not_found();
|
||||
|
||||
@@ -167,4 +167,12 @@ class repository_user extends repository {
|
||||
public function contains_private_data() {
|
||||
return false;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function send_file($storedfile, $lifetime=null , $filter=0, $forcedownload=false, ?array $options = null) {
|
||||
// If the file is linked to the original then we should not cache it.
|
||||
$lifetime = 0;
|
||||
|
||||
parent::send_file($storedfile, $lifetime, $filter, $forcedownload, $options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user