A free, self-hostable news aggregator…
Fix archiving (#5935)
Alexandre Alapetiteb46ea88c3580
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.phpindex ffba5186f..5a5128346 100644--- a/app/Controllers/configureController.php+++ b/app/Controllers/configureController.php@@ -258,13 +258,15 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {'keep_period_count' => '3','keep_period_unit' => 'P1M',];- $keepPeriod = FreshRSS_Context::$user_conf->archiving['keep_period'];- if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $keepPeriod, $matches)) {- $volatile = [- 'enable_keep_period' => true,- 'keep_period_count' => $matches['count'],- 'keep_period_unit' => str_replace($matches['count'], '1', $keepPeriod),- ];+ if (!empty(FreshRSS_Context::$user_conf->archiving['keep_period'])) {+ $keepPeriod = FreshRSS_Context::$user_conf->archiving['keep_period'];+ if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $keepPeriod, $matches)) {+ $volatile = [+ 'enable_keep_period' => true,+ 'keep_period_count' => $matches['count'],+ 'keep_period_unit' => str_replace($matches['count'], '1', $keepPeriod),+ ];+ }}FreshRSS_Context::$user_conf->volatile = $volatile;diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.phpindex b51c2b632..d75c76bcb 100644--- a/app/Models/UserConfiguration.php+++ b/app/Models/UserConfiguration.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** @property string $apiPasswordHash- * @property array<string,mixed> $archiving+ * @property array{'keep_period':string|false,'keep_max':int|false,'keep_min':int|false,'keep_favourites':bool,'keep_labels':bool,'keep_unreads':bool} $archiving* @property bool $auto_load_more* @property bool $auto_remove_article* @property bool $bottomline_date