коммит произвёл
GitHub
родитель
219bcf218b
Коммит
2b038db6ad
@@ -86,29 +86,21 @@ func desanitize(actual, target *model.Config) {
|
||||
}
|
||||
}
|
||||
|
||||
// fixConfig patches invalid or missing data in the configuration, returning true if changed.
|
||||
func fixConfig(cfg *model.Config) bool {
|
||||
changed := false
|
||||
|
||||
// fixConfig patches invalid or missing data in the configuration.
|
||||
func fixConfig(cfg *model.Config) {
|
||||
// Ensure SiteURL has no trailing slash.
|
||||
if strings.HasSuffix(*cfg.ServiceSettings.SiteURL, "/") {
|
||||
*cfg.ServiceSettings.SiteURL = strings.TrimRight(*cfg.ServiceSettings.SiteURL, "/")
|
||||
changed = true
|
||||
}
|
||||
|
||||
// Ensure the directory for a local file store has a trailing slash.
|
||||
if *cfg.FileSettings.DriverName == model.IMAGE_DRIVER_LOCAL {
|
||||
if *cfg.FileSettings.Directory != "" && !strings.HasSuffix(*cfg.FileSettings.Directory, "/") {
|
||||
*cfg.FileSettings.Directory += "/"
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
|
||||
if FixInvalidLocales(cfg) {
|
||||
changed = true
|
||||
}
|
||||
|
||||
return changed
|
||||
FixInvalidLocales(cfg)
|
||||
}
|
||||
|
||||
// FixInvalidLocales checks and corrects the given config for invalid locale-related settings.
|
||||
|
||||
Ссылка в новой задаче
Block a user