Commit 48422774 authored by StilgarBF's avatar StilgarBF Committed by Clemens John

fix function-calls in "empty" for community-config

parent 404a5114
......@@ -13,12 +13,22 @@ try {
$configSavedCommunityJson = ConfigLine::configByName('community_json');
if(empty($configSavedCommunityJson) || empty(json_decode($configSavedCommunityJson)))
if(empty($configSavedCommunityJson))
{
// no json in config - exit
return;
}
$communityJson = json_decode($configSavedCommunityJson);
if(empty($communityJson))
{
// no valid json or empty
return;
}
try
{
$query = "SELECT COUNT(*) AS count FROM routers";
......
......@@ -124,7 +124,9 @@ if(Permission::checkPermission(PERM_ROOT)) {
if(!empty($_POST['community_json']))
{
if(!empty(json_decode($_POST['community_json'])))
$communityJson = json_decode($_POST['community_json']);
if(!empty($communityJson))
{
// community-json posted and valid json
Config::writeConfigLine('community_json', $_POST['community_json']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment