From 5bc089a94ff7c8ec4fa6de08c5610ca1f665de6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 19 Feb 2022 09:49:41 +0100 Subject: [PATCH] fix track --- src/Jirafeau/a.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Jirafeau/a.php b/src/Jirafeau/a.php index 6280a4e..0590c83 100644 --- a/src/Jirafeau/a.php +++ b/src/Jirafeau/a.php @@ -181,10 +181,7 @@ function rmSenderTrack ($sender) { unlink (VAR_TRACKS.$sender); } function getSenderTrack ($sender) { - if (!$sender) - return false; - return false; - //return file_exists (VAR_TRACKS.$sender); + return $sender && file_exists (VAR_TRACKS.$sender); } // ======================================== @@ -205,9 +202,9 @@ function rmSenderPeriod ($sender) { unlink (VAR_PERIOD.$sender); } function getSenderPeriod ($sender) { - if (!$sender || !file_exists (VAR_PERIOD.$sender)) - return DEFAULT_PERIOD; - return trim (file (VAR_PERIOD.$sender)[0]); + if ($sender && file_exists (VAR_PERIOD.$sender)) + return trim (file (VAR_PERIOD.$sender)[0]); + return DEFAULT_PERIOD; } function period2seconds ($periodName) {