Merge branch 'm27_MDL-40379_Prevent_Some_Mobile_Network_Providers_From_Modifying_Content' of https://github.com/scara/moodle
This commit is contained in:
+8
-8
@@ -2188,11 +2188,11 @@ function send_temp_file($path, $filename, $pathisstring=false) {
|
||||
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431
|
||||
header('Cache-Control: private, max-age=10');
|
||||
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');
|
||||
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
@@ -2274,18 +2274,18 @@ function send_file($path, $filename, $lifetime = null , $filter=0, $pathisstring
|
||||
$private = ' private,';
|
||||
}
|
||||
$nobyteserving = false;
|
||||
header('Cache-Control:'.$private.' max-age='.$lifetime);
|
||||
header('Cache-Control:'.$private.' max-age='.$lifetime.', no-transform');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
|
||||
header('Pragma: ');
|
||||
|
||||
} else { // Do not cache files in proxies and browsers
|
||||
$nobyteserving = true;
|
||||
if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431
|
||||
header('Cache-Control: private, max-age=10');
|
||||
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');
|
||||
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
@@ -2445,17 +2445,17 @@ function send_stored_file($stored_file, $lifetime=null, $filter=0, $forcedownloa
|
||||
if (isloggedin() and !isguestuser()) {
|
||||
$private = ' private,';
|
||||
}
|
||||
header('Cache-Control:'.$private.' max-age='.$lifetime);
|
||||
header('Cache-Control:'.$private.' max-age='.$lifetime.', no-transform');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
|
||||
header('Pragma: ');
|
||||
|
||||
} else { // Do not cache files in proxies and browsers
|
||||
if (strpos($CFG->wwwroot, 'https://') === 0) { //https sites - watch out for IE! KB812935 and KB316431
|
||||
header('Cache-Control: private, max-age=10');
|
||||
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');
|
||||
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform');
|
||||
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user