From 09d69ab2dee2666c9174b9f00aedb8d4f4b917d2 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Sun, 3 Mar 2024 13:55:26 -0700 Subject: [PATCH] Fix bug (hopefully) where deleting all subs did not allow new subs to be added. --- Rocksolid_Light/rocksolid/newsportal.php | 5 +++++ Rocksolid_Light/spoolnews/user.php | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index e0b6e3e..315393e 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1949,6 +1949,11 @@ function get_user_mail_auth_data($user) $userfile = $spooldir . '/' . $user . '-articleviews.dat'; if (is_file($userfile)) { $userdata = unserialize(file_get_contents($userfile)); + if(!is_array($userdata)) { + $userdata['DO.NOT.DELETE'] = time(); + } + } else { + $userdata['DO.NOT.DELETE'] = time(); } return $userdata; } diff --git a/Rocksolid_Light/spoolnews/user.php b/Rocksolid_Light/spoolnews/user.php index e9d22c7..e9d57c8 100644 --- a/Rocksolid_Light/spoolnews/user.php +++ b/Rocksolid_Light/spoolnews/user.php @@ -298,10 +298,10 @@ if (isset($_POST['command']) && $_POST['command'] == 'SaveConfig') { $_SESSION['theme'] = $user_config['theme']; $mysubs = explode("\n", $_POST['subscribed']); foreach ($mysubs as $sub) { - if (trim($sub) == '') { + $sub = trim($sub); + if ($sub == '') { continue; } - $sub = trim($sub); if (! isset($userdata[$sub])) { $userdata[$sub] = 0; } @@ -395,6 +395,9 @@ if (isset($_POST['command']) && $_POST['command'] == 'Configuration') { echo '

Subscribed:

'; echo '';