Make sure error_log() always receives a string

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2018-07-23 16:30:38 +02:00
parent 6b440cc365
commit b788f0a456
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA

View file

@ -145,6 +145,9 @@ class File implements IWriter, IFileBased {
error_log($entry); error_log($entry);
} }
if (php_sapi_name() === 'cli-server') { if (php_sapi_name() === 'cli-server') {
if (!\is_string($message)) {
$message = json_encode($message);
}
error_log($message, 4); error_log($message, 4);
} }
} }