mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
merged from MOODLE_14_STABLE:
initialized $image and moved filemtime after file_exists
This commit is contained in:
parent
2a488ba553
commit
a7668713dd
@ -28,13 +28,13 @@
|
||||
$pathname = "$CFG->dataroot/users/$userid/$image";
|
||||
$filetype = "image/jpeg";
|
||||
} else {
|
||||
$image = "f1.png";
|
||||
$pathname = "$CFG->dirroot/pix/u/f1.png";
|
||||
$filetype = "image/png";
|
||||
}
|
||||
|
||||
$lastmodified = filemtime($pathname);
|
||||
|
||||
if (file_exists($pathname)) {
|
||||
$lastmodified = filemtime($pathname);
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
|
||||
header("Cache-control: max_age = $lifetime"); // a day
|
||||
|
@ -28,13 +28,13 @@
|
||||
$pathname = "$CFG->dataroot/groups/$groupid/$image";
|
||||
$filetype = "image/jpeg";
|
||||
} else {
|
||||
$image = "f1.png";
|
||||
$pathname = "$CFG->dirroot/pix/g/f1.png";
|
||||
$filetype = "image/png";
|
||||
}
|
||||
|
||||
$lastmodified = filemtime($pathname);
|
||||
|
||||
if (file_exists($pathname)) {
|
||||
$lastmodified = filemtime($pathname);
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
|
||||
header("Cache-control: max_age = $lifetime"); // a day
|
||||
|
Loading…
x
Reference in New Issue
Block a user