Fix chmod on file descriptor

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
This commit is contained in:
J0WI 2020-07-03 20:53:54 +02:00 committed by backportbot[bot]
parent eded52eae7
commit 9b028a619a
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class File extends LogDetails implements IWriter, IFileBased {
public function write(string $app, $message, int $level) {
$entry = $this->logDetailsAsJSON($app, $message, $level);
$handle = @fopen($this->logFile, 'a');
if ($this->logFileMode > 0 && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
if ($this->logFileMode > 0 && is_file($this->logFile) && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
@chmod($this->logFile, $this->logFileMode);
}
if ($handle) {