changeset 183:dda30eff3266

Fix handling of data modification timestamps.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 30 Sep 2015 08:39:24 +0300
parents a59bb75aa0ec
children 04490fe590ec
files index.php
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/index.php	Wed Sep 30 08:38:52 2015 +0300
+++ b/index.php	Wed Sep 30 08:39:24 2015 +0300
@@ -322,13 +322,12 @@
 }
 
 
-function lukReadClassFile($filename, &$mtimestamp)
+function lukReadClassFile($filename)
 {
   // Attempt to open file for reading
   if (($fp = @fopen($filename, "rb")) === false)
     return false;
 
-  $mtimestamp = filemtime($filename);
   $mclasses = FALSE;
 
   // Lock file so that we do not get clashes
@@ -525,7 +524,7 @@
 
 
 // Read classfile
-if (($classIDs = lukReadClassFile($classIDFile[$nextPeriod], $timestamp)) === false)
+if (($classIDs = lukReadClassFile($classIDFile[$nextPeriod])) === false)
   stError(cmQM("classListNotFound"));
 
 
@@ -535,11 +534,13 @@
 {
   stError(cmQM("classDataNotFound", chentities($classID)));
   $haveData = FALSE;
+  $timestamp = time();
 }
 else
 {
   require($dataFile);
   $haveData = isset($classInfo);
+  $timestamp = filemtime($dataFile);
 }