From b46ea88c3580bea1b303e02602b9ec94d5303776 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 10 Dec 2023 12:41:24 +0100 Subject: Fix archiving (#5935) fix https://github.com/FreshRSS/FreshRSS/issues/5934 Regression from https://github.com/FreshRSS/FreshRSS/pull/5830 --- app/Controllers/configureController.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 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\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\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; -- cgit v1.2.3