From e33ef74af9ff2f8ba1c6909b78ee07633cff240a Mon Sep 17 00:00:00 2001 From: Inverle Date: Wed, 30 Jul 2025 08:03:04 +0200 Subject: `before_login_btn` hook + system conf attributes (#7761) * `before_login_btn` hook + system conf attributes * phpstan fix * Refactoring --------- Co-authored-by: Alexandre Alapetite --- app/Controllers/userController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/Controllers/userController.php') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 35851fceb..4ce02946b 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -54,8 +54,8 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { } foreach ($userConfigUpdated as $configName => $configValue) { - if ($configValue !== null) { - $userConfig->_param($configName, $configValue); + if ($configName !== '' && $configValue !== null) { + $userConfig->_attribute($configName, $configValue); } } @@ -624,7 +624,12 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { return; } - $userConfig->_param($field, $value); + if ($field === '') { + Minz_Error::error(400, 'Invalid field name'); + return; + } + + $userConfig->_attribute($field, $value); $ok = $userConfig->save(); FreshRSS_UserDAO::touch($username); -- cgit v1.2.3