From 2bc28aa29fa493d60d23d68c5e752e60be909b32 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 9 Mar 2023 16:30:55 +0700 Subject: [PATCH] Fixed checking exists a file to create a cache https: //github.com/torrentpier/torrentpier/pull/481 Co-Authored-By: Vasily Komrakov <425040+diolektor@users.noreply.github.com> --- common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.php b/common.php index 04531e9df..8c4b6d479 100644 --- a/common.php +++ b/common.php @@ -253,7 +253,7 @@ function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replac rename($file, $new_name); } } - if (file_exists($file) && $dir_created = bb_mkdir(dirname($file))) { + if (!file_exists($file) && $dir_created = bb_mkdir(dirname($file))) { $fp = fopen($file, 'ab+'); } if (isset($fp)) {