2013-01-09 Hirofumi Kosaka <kosaka@rworks.jp>

* include/functions.php: Fixed that the console sometimes shows
	negative timestamp (e.g. '-2 sec') when using 'comparison in
	roll-over' format.  Merged from 4.0.x.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7380 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
hkosaka 2013-01-09 01:48:47 +00:00
parent b981fc6add
commit 6d19ff0a33
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-01-09 Hirofumi Kosaka <kosaka@rworks.jp>
* include/functions.php: Fixed that the console sometimes shows
negative timestamp (e.g. '-2 sec') when using 'comparison in
roll-over' format. Merged from 4.0.x.
2013-01-08 Dario Rodriguez <dario.rodriguez@artica.es>
* extensions/system_info.php: Added link to download System info file.

View File

@ -322,6 +322,13 @@ function human_time_comparation ($timestamp, $units = 'large') {
}
$seconds = get_system_time () - $timestamp;
// $seconds could be negative, because get_system_time() could return cached value
// (that might be the time a session begins at).
// So negative values are to be rounded off to 'NOW'.
if( $seconds < 0 ) {
$seconds = 0;
}
return human_time_description_raw($seconds, false, $units);
}
@ -1676,4 +1683,4 @@ function copy_dir($src, $dst) {
}
closedir($dir);
}
?>
?>