aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-10-27 18:04:59 +0100
committerGravatar GitHub <noreply@github.com> 2019-10-27 18:04:59 +0100
commite4511c3d342c1cc5a9f9bfe8f726ae9aaa451a26 (patch)
tree2239a6e27d343d11d12fa138d985a72c8852099f /app/Models/Context.php
parent571fb31af819ad2c53ee9cabccc0eeb62b915ae9 (diff)
keep_max disabled by default for existing installations (#2607)
Fix https://github.com/FreshRSS/FreshRSS/issues/2600 Second attempt https://github.com/FreshRSS/FreshRSS/pull/2602
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php
index bfc4299c9..e27330665 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -54,14 +54,13 @@ class FreshRSS_Context {
//Legacy
$oldEntries = (int)FreshRSS_Context::$user_conf->param('old_entries', 0);
- if ($oldEntries > 0) { //Freshrss < 1.15
- $archiving['keep_period'] = 'P' . $oldEntries . 'M';
- }
-
$keepMin = (int)FreshRSS_Context::$user_conf->param('keep_history_default', -5);
- if ($keepMin > -5) { //Freshrss < 1.15
+ if ($oldEntries > 0 || $keepMin > -5) { //Freshrss < 1.15
$archiving = FreshRSS_Context::$user_conf->archiving;
$archiving['keep_max'] = false;
+ if ($oldEntries > 0) {
+ $archiving['keep_period'] = 'P' . $oldEntries . 'M';
+ }
if ($keepMin > 0) {
$archiving['keep_min'] = $keepMin;
} elseif ($keepMin == -1) { //Infinite