From e76d9f871791a883f07b4188615963c9cd1b4625 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Mon, 19 Feb 2024 12:25:18 -0300 Subject: [PATCH] Update --- objects/functions.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/objects/functions.php b/objects/functions.php index 671b5b0e8..702d87871 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -1138,13 +1138,15 @@ function _utf8_encode($string) { } function _rename($originalFile, $newName) { - // Attempt to rename the file - if (@rename($originalFile, $newName)) { - return true; - } else { - // Rename failed, try to copy and delete - if (copy($originalFile, $newName) && @unlink($originalFile)) { + if(!empty($originalFile) && !empty($newName)){ + // Attempt to rename the file + if (@rename($originalFile, $newName)) { return true; + } else { + // Rename failed, try to copy and delete + if (copy($originalFile, $newName) && @unlink($originalFile)) { + return true; + } } }