]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not create a new version if previousNode has the same mtime 39003/head
authorLouis Chemineau <louis@chmn.me>
Thu, 22 Jun 2023 15:49:49 +0000 (17:49 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 12 Jul 2023 17:55:30 +0000 (19:55 +0200)
Signed-off-by: Louis Chemineau <louis@chmn.me>
apps/files_versions/lib/Listener/FileEventsListener.php

index 1777342feab09855ccbc8222e5f9bc8491c46f51..fe638364b9d0da7e48d14ac5868325a3bfe8be03 100644 (file)
@@ -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.