From ae659e3c84aaf86623895fc6767da114f1db331c Mon Sep 17 00:00:00 2001 From: "CORP\\Rachel.Breeze" Date: Thu, 3 Nov 2016 13:40:46 +0000 Subject: [PATCH] U4-7239 Now trims the parameters so that if a default is set in a comma and space seperated list, the parameter is now populated. --- src/Umbraco.Web/umbraco.presentation/helper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/umbraco.presentation/helper.cs b/src/Umbraco.Web/umbraco.presentation/helper.cs index 0d133fee66..2bee9d1e3a 100644 --- a/src/Umbraco.Web/umbraco.presentation/helper.cs +++ b/src/Umbraco.Web/umbraco.presentation/helper.cs @@ -95,12 +95,14 @@ namespace umbraco { var attributeValueSplit = (attributeValue).Split(','); + attributeValueSplit = attributeValueSplit.Select(x => x.Trim()).ToArray(); + // before proceeding, we don't want to process anything here unless each item starts/ends with a [ ] // this is because the attribute value could actually just be a json array like [1,2,3] which we don't want to parse // // however, the last one can be a literal, must take care of this! // so here, don't check the last one, which can be just anything - if (attributeValueSplit.Take(attributeValueSplit.Length - 1).All(x => + if (attributeValueSplit.Take(attributeValueSplit.Length - 1).All(x => //must end with [ x.EndsWith("]") && //must start with [ and a special char