From 177d66f811ca5c52f31cc08ac0bca90d0e868194 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Wed, 4 Apr 2018 19:06:19 +0000 Subject: [PATCH] closed https://github.com/dg9vh/MMDVMHost-Dashboard/issues/174 tnx to m1geo --- include/tools.php | 40 +++++++++++++++++++++------------------- version.php | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/include/tools.php b/include/tools.php index 06cdc44..204436f 100644 --- a/include/tools.php +++ b/include/tools.php @@ -89,37 +89,39 @@ function checkSetup() { } function startStopwatch() { - $time = microtime(); - $time = explode(' ', $time); - $time = $time[1] + $time[0]; - $_SESSION['starttime'] = $time; - return $time; + $time = microtime(); + $time = explode(' ', $time); + $time = $time[1] + $time[0]; + $_SESSION['starttime'] = $time; + return $time; } function getLapTime() { - $start = $_SESSION['starttime']; - $time = microtime(); - $time = explode(' ', $time); - $time = $time[1] + $time[0]; - $finish = $time; - $lap_time = round(($finish - $start), 4); - return $lap_time; + $start = $_SESSION['starttime']; + $time = microtime(); + $time = explode(' ', $time); + $time = $time[1] + $time[0]; + $finish = $time; + $lap_time = round(($finish - $start), 4); + return $lap_time; } function showLapTime($func) { - if( defined("DEBUG") ) { - ?>setTimezone(new DateTimeZone(TIMEZONE)); - return $date->format('Y-m-d H:i:s'); + try { + $date = new DateTime($timestamp); + $date->setTimezone(new DateTimeZone(TIMEZONE)); + return $date->format('Y-m-d H:i:s'); + } catch (Exception $err) {} } function encode($hex) { - $validchars = " abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789"; + $validchars = " abcdefghijklmnopqrstuvwxyzäöüßABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789"; $str = ''; $chrval = hexdec($hex); $str = chr($chrval); diff --git a/version.php b/version.php index 8fde4b8..c60fe7c 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@