mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Some reported bugfixes (#1275)
* Some reported bugfixes * Updated * Update common.php * Update BBCode.php
This commit is contained in:
parent
13bf41e776
commit
e8a90b025c
5 changed files with 29 additions and 31 deletions
|
@ -190,11 +190,11 @@ function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replac
|
|||
$bytes_written = false;
|
||||
clearstatcache();
|
||||
|
||||
if (($max_size && file_exists($file) && is_file($file)) && filesize($file) >= $max_size) {
|
||||
if (is_file($file) && ($max_size && filesize($file) >= $max_size)) {
|
||||
$file_parts = pathinfo($file);
|
||||
$new_name = ($file_parts['dirname'] . '/' . $file_parts['filename'] . '_[old]_' . date('Y-m-d_H-i-s_') . getmypid() . '.' . $file_parts['extension']);
|
||||
clearstatcache();
|
||||
if (!file_exists($new_name) && !is_file($new_name)) {
|
||||
if (!is_file($new_name)) {
|
||||
rename($file, $new_name);
|
||||
}
|
||||
}
|
||||
|
@ -269,6 +269,7 @@ function str_compact($str)
|
|||
*
|
||||
* @param int $length
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
function make_rand_str(int $length = 10): string
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue