Log sanitization
This commit is contained in:
parent
ec42f14bf9
commit
3cb24dc413
@ -68,6 +68,11 @@ class Logger
|
||||
$this->optional = Absolute::absolute(getcwd().'/MadelineProto.log');
|
||||
}
|
||||
|
||||
if ($this->mode === 2 && !preg_match('/\.log$/', $this->optional)) {
|
||||
$this->optional .= '.log';
|
||||
}
|
||||
|
||||
|
||||
if ($mode === 2 && $max_size !== -1 && file_exists($this->optional) && filesize($this->optional) > $max_size) {
|
||||
unlink($this->optional);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user