From: skodak Date: Thu, 4 Nov 2004 09:34:27 +0000 (+0000) Subject: merged from MOODLE_14_STABLE: X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a7668713dd995bfa6ebc61e56279f46d06cec6d1;p=moodle.git merged from MOODLE_14_STABLE: initialized $image and moved filemtime after file_exists --- diff --git a/user/pix.php b/user/pix.php index 9792148938..1e649b4fb4 100644 --- a/user/pix.php +++ b/user/pix.php @@ -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 diff --git a/user/pixgroup.php b/user/pixgroup.php index c5505a204c..793afb4b2a 100644 --- a/user/pixgroup.php +++ b/user/pixgroup.php @@ -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