mirror of
https://github.com/nextcloud/server.git
synced 2026-04-23 07:08:34 -04:00
fix(files_versions): Do not create a new version for empty files
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
1e9f438d1a
commit
66fbb7be76
1 changed files with 3 additions and 2 deletions
|
|
@ -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…
Reference in a new issue