Merge pull request #10355 from nextcloud/bugfix/noid/make-sure-error-log-always-receives-a-string

Make sure error_log() always receives a string
This commit is contained in:
Roeland Jago Douma 2018-07-23 21:17:38 +02:00 committed by GitHub
commit f25d34b293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}