From aa7f7b3ea66e0155960765d1213c632dafa74918 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Mon, 18 Jan 2016 00:24:36 +0100 Subject: [PATCH] fix: use PHP_EOL for carriage returns in file logs Relates to #436 Signed-off-by: VirtualTam --- application/Utils.php | 2 +- tests/UtilsTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/Utils.php b/application/Utils.php index cb30595..551db3e 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 f3bb556..3073b5e 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -51,7 +51,7 @@ class UtilsTest extends PHPUnit_Framework_TestCase protected function getLastLogEntry() { $logFile = file(self::$testLogFile); - return explode(' - ', trim(array_pop($logFile), '\n')); + return explode(' - ', trim(array_pop($logFile), PHP_EOL)); } /**