mirror of
https://github.com/nextcloud/server.git
synced 2026-06-15 11:41:20 -04:00
fix: Fix mtime preservation on rename in KnownMtime wrapper
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
56918bfe29
commit
d176d3cd9a
1 changed files with 3 additions and 2 deletions
|
|
@ -86,7 +86,7 @@ class KnownMtime extends Wrapper {
|
|||
public function rename($source, $target) {
|
||||
$result = parent::rename($source, $target);
|
||||
if ($result) {
|
||||
$this->knowMtimes->set($target, $this->clock->now()->getTimestamp());
|
||||
$this->knowMtimes->set($target, $this->filemtime($source));
|
||||
$this->knowMtimes->set($source, $this->clock->now()->getTimestamp());
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -125,9 +125,10 @@ class KnownMtime extends Wrapper {
|
|||
}
|
||||
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
$mTime = $sourceStorage->filemtime($sourceInternalPath);
|
||||
$result = parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
|
||||
if ($result) {
|
||||
$this->knowMtimes->set($targetInternalPath, $this->clock->now()->getTimestamp());
|
||||
$this->knowMtimes->set($targetInternalPath, $mTime);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue