diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-08-06 11:41:24 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-08-07 11:11:51 +0300 |
commit | f200199926719b6f7ade7dbd9675137b10f1debb (patch) | |
tree | eb46b1bb8eedb1c0ec9603347fb67a9a243867f7 /lib | |
parent | 457a1f1745ecaf5147feca467c6aa1363acacaaf (diff) |
Fix version checks
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/DocumentService.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Service/DocumentService.php b/lib/Service/DocumentService.php index 2b2bd6064..bbfb2b199 100644 --- a/lib/Service/DocumentService.php +++ b/lib/Service/DocumentService.php @@ -252,9 +252,10 @@ class DocumentService { return $document; } // Do not save if version already saved - if (!$force && $version <= (string)$document->getLastSavedVersion()) { + if (!$force && ($version <= (string)$document->getLastSavedVersion() || $version > (string)$document->getCurrentVersion())) { return $document; } + // Only save once every AUTOSAVE_MINIMUM_DELAY seconds if ($file->getMTime() === $lastMTime && $lastMTime > time() - self::AUTOSAVE_MINIMUM_DELAY && $manualSave === false) { return $document; |