Merge pull request #43931 from nextcloud/backport/43896/stable27

This commit is contained in:
John Molakvoæ 2024-03-01 11:00:23 +01:00 committed by GitHub
commit 57d84c5446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -218,11 +218,12 @@ class FileEventsListener implements IEventListener {
}
if (
($writeHookInfo['versionCreated'] || $writeHookInfo['previousNode']->getSize() === 0) &&
$writeHookInfo['versionCreated'] &&
$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.
// If both versions have the same mtime, it means the latest version file simply got overrode,
// so no need to create a new version.
$this->created($node);
} else {
try {