diff --git a/lib/Versions/ExpireManager.php b/lib/Versions/ExpireManager.php index e4f63bb29..9f82e42d3 100644 --- a/lib/Versions/ExpireManager.php +++ b/lib/Versions/ExpireManager.php @@ -66,8 +66,11 @@ protected function getAutoExpireList(int $time, array $versions): array { while ($newInterval) { if ($nextInterval === -1 || $prevTimestamp > $nextInterval) { if ($version->getTimestamp() > $nextVersion) { - //distance between two version too small, mark to delete - $toDelete[] = $version; + // Do not expire versions with a label. + if (!($version instanceof IMetadataVersion) || $version->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') { + //distance between two version too small, mark to delete + $toDelete[] = $version; + } } else { $nextVersion = $version->getTimestamp() - $step; $prevTimestamp = $version->getTimestamp();