merged from MOODLE_14_STABLE:

initialized $image and moved filemtime after file_exists
This commit is contained in:
skodak 2004-11-04 09:34:27 +00:00
parent 2a488ba553
commit a7668713dd
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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