mirror of
https://github.com/getgrav/grav.git
synced 2026-07-08 16:53:16 +02:00
Try rename before doing copy&delete
This commit is contained in:
@@ -340,8 +340,11 @@ abstract class Folder
|
||||
// Make sure that path to the target exists before moving.
|
||||
self::create(dirname($target));
|
||||
|
||||
self::copy($source, $target);
|
||||
self::delete($source);
|
||||
$success = @rename($source, $target);
|
||||
if (!$success) {
|
||||
self::copy($source, $target);
|
||||
self::delete($source);
|
||||
}
|
||||
|
||||
// Make sure that the change will be detected when caching.
|
||||
@touch(dirname($source));
|
||||
|
||||
Reference in New Issue
Block a user