mirror of
https://github.com/knadh/listmonk.git
synced 2024-12-26 08:51:52 +08:00
Make CSV (import) header fields agnostic of surrounding spaces. Closes #2189.
This commit is contained in:
parent
63712285aa
commit
97fde64461
1 changed files with 1 additions and 1 deletions
|
@ -666,7 +666,7 @@ func (s *Session) mapCSVHeaders(csvHdrs []string, knownHdrs map[string]bool) map
|
||||||
hdrKeys := make(map[string]int)
|
hdrKeys := make(map[string]int)
|
||||||
for i, h := range csvHdrs {
|
for i, h := range csvHdrs {
|
||||||
// Clean the string of non-ASCII characters (BOM etc.).
|
// Clean the string of non-ASCII characters (BOM etc.).
|
||||||
h := regexCleanStr.ReplaceAllString(h, "")
|
h := regexCleanStr.ReplaceAllString(strings.TrimSpace(h), "")
|
||||||
if _, ok := knownHdrs[h]; !ok {
|
if _, ok := knownHdrs[h]; !ok {
|
||||||
s.log.Printf("ignoring unknown header '%s'", h)
|
s.log.Printf("ignoring unknown header '%s'", h)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue