aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-06-22 17:49:49 +0200
committerLouis Chemineau <louis@chmn.me>2023-06-22 17:49:49 +0200
commit7fec07196de645aefacc0cb7df94ecac1d518c67 (patch)
treea00ed532cd4f0a4ef873b5057e27d8ae2e07735b /apps/files_versions
parentb94145f6bd2c17c74f8319386bc96c3eb486637e (diff)
downloadnextcloud-server-7fec07196de645aefacc0cb7df94ecac1d518c67.tar.gz
nextcloud-server-7fec07196de645aefacc0cb7df94ecac1d518c67.zip
Do not create a new version if previousNode has the same mtime
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/Listener/FileEventsListener.php4
1 files changed, 2 insertions, 2 deletions
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.