Incorrect log file rotation regex (#77)

torrentpier/torrentpier#432
This commit is contained in:
Roman Kelesidis 2023-03-31 23:57:20 +07:00 committed by GitHub
parent 5ad5ecba29
commit 4eb7884f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,7 @@ function file_write ($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $repla
if ($max_size && @filesize($file) >= $max_size) if ($max_size && @filesize($file) >= $max_size)
{ {
$old_name = $file; $ext = ''; $old_name = $file; $ext = '';
if (preg_match('#^(.+)(\.[^\\/]+)$#', $file, $matches)) if (preg_match('#^(.+)(\.[^\\\/]+)$#', $file, $matches))
{ {
$old_name = $matches[1]; $ext = $matches[2]; $old_name = $matches[1]; $ext = $matches[2];
} }