From b788f0a456d7c71d1270f8cf0288e8bb71fe8fcc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 23 Jul 2018 16:30:38 +0200 Subject: [PATCH] Make sure error_log() always receives a string Signed-off-by: Joas Schilling --- lib/private/Log/File.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index 597cb54e40..c881c6dd9d 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -145,6 +145,9 @@ class File implements IWriter, IFileBased { error_log($entry); } if (php_sapi_name() === 'cli-server') { + if (!\is_string($message)) { + $message = json_encode($message); + } error_log($message, 4); } }