X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModule%2FInstall.php;h=4385ba85175dcb361dc183e5e949fc5c40fe04de;hb=5a9ef594bf1fe2732cfc9dccb6973bfbbaaf3b91;hp=c766dd551583cad8349e73b3daa7163232642209;hpb=645e4edc63a6b4cb273e06590a77f99619037e7b;p=friendica.git diff --git a/src/Module/Install.php b/src/Module/Install.php index c766dd5515..4385ba8517 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -65,7 +65,7 @@ class Install extends BaseModule * @var Core\Installer The installer */ private $installer; - + /** @var App */ protected $app; /** @var App\Mode */ @@ -385,12 +385,21 @@ class Install extends BaseModule * @param string $key The key of the setting * @param null|string $default The default value */ - private function checkSetting(Cache $configCache, array $post, $cat, $key, $default = null) + private function checkSetting(Cache $configCache, array $post, string $cat, string $key, ?string $default = null) { - $configCache->set($cat, $key, - trim(($post[sprintf('%s-%s', $cat, $key)] ?? '') ?: - ($default ?? $configCache->get($cat, $key)) - ) - ); + $value = null; + + if (isset($post[sprintf('%s-%s', $cat, $key)])) { + $value = trim($post[sprintf('%s-%s', $cat, $key)]); + } + + if (isset($value)) { + $configCache->set($cat, $key, $value, Cache::SOURCE_ENV); + return; + } + + if (isset($default)) { + $configCache->set($cat, $key, $default, Cache::SOURCE_ENV); + } } }