Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initialized $image and moved filemtime after file_exists

  • Loading branch information...
commit d52e13002e054a4a0b0c219b1bd15e4154812b1a 1 parent d8d356d
skodak authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 user/pix.php
  2. +2 −2 user/pixgroup.php
View
4 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
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.