From: Louis Chemineau Date: Thu, 22 Jun 2023 15:49:49 +0000 (+0200) Subject: Do not create a new version if previousNode has the same mtime X-Git-Tag: v26.0.4rc1~3^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4742901124ad6cf6e98b65cba6e14259c2b5b3cd;p=nextcloud-server.git Do not create a new version if previousNode has the same mtime Signed-off-by: Louis Chemineau --- diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php index 1777342feab..fe638364b9d 100644 --- a/apps/files_versions/lib/Listener/FileEventsListener.php +++ b/apps/files_versions/lib/Listener/FileEventsListener.php @@ -232,8 +232,8 @@ class FileEventsListener implements IEventListener { } if ( - ($writeHookInfo['versionCreated'] && $node->getMTime() !== $writeHookInfo['previousNode']->getMTime()) || - $writeHookInfo['previousNode']->getSize() === 0 + ($writeHookInfo['versionCreated'] || $writeHookInfo['previousNode']->getSize() === 0) && + $node->getMTime() !== $writeHookInfo['previousNode']->getMTime() ) { // If a new version was created, insert a version in the DB for the current content. // Unless both versions have the same mtime.