From 68095d3c40ca05e723a69a8b084fbb60360cb05b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 19 Nov 2024 19:59:28 +0100 Subject: [PATCH] refactoring --- lam/lib/config.inc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 83b51772c..e1c289d76 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -585,24 +585,14 @@ class ServerProfilePersistenceStrategyFiles implements ServerProfilePersistenceS // search keywords $parts = explode(': ', $line); $keyword = $parts[0]; + $keyword = trim($keyword, ':'); $startIndex = strlen($keyword) + 2; - if (sizeof($parts) == 1) { - // empty global settings + $value = (sizeof($parts) > 1) ? substr($line, $startIndex) : ''; + if (!in_array($keyword, ['modules', 'types', 'tools', 'jobs'])) { try { $property = $reflectionConfig->getProperty($keyword); $property->setAccessible(true); - $property->setValue($config, ''); - } - catch (ReflectionException) { - // ignore - } - } - elseif ((sizeof($parts) > 1) && !in_array($keyword, ['modules', 'types', 'tools', 'jobs'])) { - // global setting with value - try { - $property = $reflectionConfig->getProperty($keyword); - $property->setAccessible(true); - $property->setValue($config, substr($line, $startIndex)); + $property->setValue($config, $value); } catch (ReflectionException) { // ignore