]> git.mjollnir.org Git - moodle.git/commitdiff
merged from MOODLE_14_STABLE:
authorskodak <skodak>
Thu, 4 Nov 2004 09:34:27 +0000 (09:34 +0000)
committerskodak <skodak>
Thu, 4 Nov 2004 09:34:27 +0000 (09:34 +0000)
initialized $image and moved filemtime after file_exists

user/pix.php
user/pixgroup.php

index 979214893864c579f65d6471748387c7f33e8d42..1e649b4fb4856e95a73ddb3e54414b8fa8ae146b 100644 (file)
         $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
index c5505a204cb08389187b3dcffc9b5739cdce6799..793afb4b2a25c59eb11cb1f6273b775941d42da7 100644 (file)
         $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