From 71130219500882e273374fbb186adb88fe084175 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Wed, 11 Nov 2020 18:27:48 +0100 Subject: [PATCH] Fix: lang not initialized in saveconfig script --- utils/saveconfig.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/saveconfig.php b/utils/saveconfig.php index c5c1d3d..16d0a94 100644 --- a/utils/saveconfig.php +++ b/utils/saveconfig.php @@ -20,8 +20,12 @@ require_once(dirname(__DIR__) . "/helpers/auth.php"); require_once(ROOT_DIR . "/helpers/config.php"); +require_once(ROOT_DIR . "/helpers/lang.php"); +$config = uConfig::getInstance(); +$lang = (new uLang($config))->getStrings(); $auth = new uAuth(); + if (!$auth->isAdmin()) { uUtils::exitWithError($lang["notauthorized"]); } @@ -51,7 +55,6 @@ $data = [ 'upload_maxsize' => uUtils::postInt('uploadMaxSize') ]; -$config = uConfig::getInstance(); $config->setFromArray($data); if (!is_null($olLayers)) { $config->olLayers = []; @@ -64,6 +67,6 @@ if (!is_null($olLayers)) { } if ($config->save() === false) { - uUtils::exitWithError("Server error"); + uUtils::exitWithError($lang["servererror"]); } uUtils::exitWithSuccess();