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 committed by Morris Jobke
parent f2f723c7c8
commit 60ced31116
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 3 additions and 0 deletions

View File

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