Apply timezone cleaning to final result, closes #2546
This commit is contained in:
parent
13058ad64b
commit
560c832cc6
|
@ -211,12 +211,14 @@ func (sc *SystemConfiguration) ConfigureTimezone() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
sc.Timezone = regexp.MustCompile(`\s+$`).ReplaceAllString(string(matches[1]), "")
|
sc.Timezone = string(matches[1])
|
||||||
} else {
|
} else {
|
||||||
sc.Timezone = string(b)
|
sc.Timezone = string(b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sc.Timezone = regexp.MustCompile(`[^a-z_/]+/i`).ReplaceAllString(sc.Timezone, "")
|
||||||
|
|
||||||
_, err := time.LoadLocation(sc.Timezone)
|
_, err := time.LoadLocation(sc.Timezone)
|
||||||
|
|
||||||
return errors.Wrap(err, fmt.Sprintf("the supplied timezone %s is invalid", sc.Timezone))
|
return errors.Wrap(err, fmt.Sprintf("the supplied timezone %s is invalid", sc.Timezone))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user