diff --git a/inc/functions/fs.php b/inc/functions/fs.php index d94b2a67..2d38c384 100644 --- a/inc/functions/fs.php +++ b/inc/functions/fs.php @@ -8,3 +8,10 @@ function link_or_copy(string $from, string $to) { } return true; } + +function move_or_copy_uploaded(string $from, string $to) { + if (!\move_uploaded_file($from, $to)) { + return \copy($from, $to); + } + return true; +}