Better checks for existing files

This commit is contained in:
moodler 2005-02-10 09:15:20 +00:00
parent 73cffa5416
commit 730967f2e7
2 changed files with 10 additions and 6 deletions

View file

@ -32,11 +32,13 @@
/// Work out the last modified date for this theme /// Work out the last modified date for this theme
foreach ($THEME->sheets as $sheet) { foreach ($THEME->sheets as $sheet) {
$sheetmodified = filemtime($sheet.'.css'); if (file_exists($sheet.'.css')) {
$sheetmodified = @filemtime($sheet.'.css');
if ($sheetmodified > $lastmodified) { if ($sheetmodified > $lastmodified) {
$lastmodified = $sheetmodified; $lastmodified = $sheetmodified;
} }
} }
}
/// Print out the entire style sheet /// Print out the entire style sheet

View file

@ -27,11 +27,13 @@
/// Work out the last modified date for this theme /// Work out the last modified date for this theme
foreach ($THEME->sheets as $sheet) { foreach ($THEME->sheets as $sheet) {
if (file_exists($sheet.'.css')) {
$sheetmodified = filemtime($sheet.'.css'); $sheetmodified = filemtime($sheet.'.css');
if ($sheetmodified > $lastmodified) { if ($sheetmodified > $lastmodified) {
$lastmodified = $sheetmodified; $lastmodified = $sheetmodified;
} }
} }
}
/// Print out the entire style sheet /// Print out the entire style sheet