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)) {