Fix timezone config parser (#2169)

* make sure to parse the whole config line

* fix crash on empty timezone parameter

---------

Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
CaCO3
2023-03-12 17:01:04 +01:00
committed by GitHub
parent 512d7f95b4
commit 5e5d2e2f72

View File

@@ -175,10 +175,15 @@ bool setupTime() {
while (configFile.getNextLine(&line, disabledLine, eof) &&
!configFile.isNewParagraph(line)) {
splitted = ZerlegeZeile(line);
splitted = ZerlegeZeile(line, "=");
if (toUpper(splitted[0]) == "TIMEZONE") {
timeZone = splitted[1];
if (splitted.size() <= 1) { // parameter part is empty
timeZone = "";
}
else {
timeZone = splitted[1];
}
}
if (toUpper(splitted[0]) == "TIMESERVER") {