mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
Fix getting uninitialized default config value
- catch SQL errors in LoadConfig - incremented DB Version to 14
This commit is contained in:
parent
059334ca85
commit
18c40e1af5
@ -1908,7 +1908,7 @@ function GetConfigSetting($szSettingName, $szDefaultValue = "", $DesiredConfigLe
|
||||
if ( isset($CFG[$szSettingName]) )
|
||||
return $CFG[$szSettingName];
|
||||
else
|
||||
return $szDefaultValue;
|
||||
return (isset($szDefaultValue) ? $szDefaultValue : "");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -949,6 +949,7 @@ function LoadChartsFromDatabase()
|
||||
// ---
|
||||
|
||||
// Get Searches from DB now!
|
||||
try {
|
||||
$result = DB_Query($sqlquery);
|
||||
$myrows = DB_GetAllRows($result, true);
|
||||
if ( isset($myrows ) && count($myrows) > 0 )
|
||||
@ -974,6 +975,12 @@ function LoadChartsFromDatabase()
|
||||
// Copy to content array!
|
||||
$content['Charts'] = $CFG['Charts'];
|
||||
}
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
// DEBUG ERROR
|
||||
OutputDebugMessage("LoadChartsFromDatabase: DB Query failed with Code " . $e->getCode() . ": " . $e->getMessage(), DEBUG_ERROR);
|
||||
// Copy to content array!
|
||||
$content['Charts'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ $errdesc = "";
|
||||
$errno = 0;
|
||||
|
||||
// --- Current Database Version, this is important for automated database Updates!
|
||||
$content['database_internalversion'] = "13"; // Whenever incremented, a database upgrade is needed
|
||||
$content['database_internalversion'] = "14"; // Whenever incremented, a database upgrade is needed
|
||||
$content['database_installedversion'] = "0"; // 0 is default which means Prior Versioning Database
|
||||
// ---
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user