Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Feb 19, 2024
1 parent fdcd7bf commit e76d9f8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions objects/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit e76d9f8

Please sign in to comment.