Skip to content

Commit 1bd5d0a

Browse files
Modifying search settings deserialization to allow line breaks in the imported XML (#8882)
1 parent 165505b commit 1bd5d0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Orchard.Web/Modules/Orchard.Search/Helpers/SearchSettingsHelper.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ public static IDictionary<string, string[]> DeserializeSearchFields(string value
1818

1919
foreach (var item in items)
2020
{
21-
var pair = item.Split(new[] { ':' }, StringSplitOptions.None);
22-
var index = pair[0];
23-
var fields = pair[1].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
21+
var pair = item.Split(new[] { ':' });
22+
var index = pair[0].Trim();
23+
var fields = pair[1].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray();
2424

2525
dictionary[index] = fields;
2626
}
27+
2728
return dictionary;
2829
}
2930

0 commit comments

Comments
 (0)