Merge pull request #43896 from nextcloud/artonge/fix/version_creation_of_empty_files

Do not create a new version for empty files
pull/41434/merge
Louis 3 months ago committed by GitHub
commit b51275ce11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -219,11 +219,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 {

Loading…
Cancel
Save