4
0
Эх сурвалжийг харах

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
Alexandre Alapetite 6 жил өмнө
parent
commit
e4511c3d34

+ 4 - 5
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