diff --git a/application/Utils.php b/application/Utils.php index cb30595f..551db3e7 100644 --- a/application/Utils.php +++ b/application/Utils.php @@ -16,7 +16,7 @@ function logm($logFile, $clientIp, $message) { file_put_contents( $logFile, - date('Y/m/d H:i:s').' - '.$clientIp.' - '.strval($message).'\n', + date('Y/m/d H:i:s').' - '.$clientIp.' - '.strval($message).PHP_EOL, FILE_APPEND ); } diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index f3bb556e..3073b5eb 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -51,7 +51,7 @@ protected function setUp() protected function getLastLogEntry() { $logFile = file(self::$testLogFile); - return explode(' - ', trim(array_pop($logFile), '\n')); + return explode(' - ', trim(array_pop($logFile), PHP_EOL)); } /**