From 6f39439e3dffd915e885f6186f19b8e3d3436fdf Mon Sep 17 00:00:00 2001 From: Claus Date: Tue, 15 Nov 2016 12:10:36 +0100 Subject: [PATCH] removing string.empty checks for attributes. removing the redundant clean for outputting model.value in TextString.cshtml. --- .../Views/Partials/Grid/Bootstrap2-Fluid.cshtml | 5 +---- src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml | 5 +---- .../Views/Partials/Grid/Bootstrap3-Fluid.cshtml | 5 +---- src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml | 5 +---- .../Views/Partials/Grid/Editors/TextString.cshtml | 2 +- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2-Fluid.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2-Fluid.cshtml index 65b9b8abc7..f6b93139ce 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2-Fluid.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2-Fluid.cshtml @@ -67,10 +67,7 @@ foreach (JProperty property in cfg.Properties()) { var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString()); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - attrs.Add(property.Name + "='" + propertyValue + "'"); - } + attrs.Add(property.Name + "=\"" + propertyValue + "\""); } JObject style = contentItem.styles; diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml index 37e3c84dad..c5fabe2abf 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap2.cshtml @@ -67,10 +67,7 @@ foreach (JProperty property in cfg.Properties()) { var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString()); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - attrs.Add(property.Name + "=\"" + propertyValue + "\""); - } + attrs.Add(property.Name + "=\"" + propertyValue + "\""); } JObject style = contentItem.styles; diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml index 45be239245..b7e8ef34fb 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml @@ -63,10 +63,7 @@ foreach (JProperty property in cfg.Properties()) { var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString()); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - attrs.Add(property.Name + "='" + propertyValue + "'"); - } + attrs.Add(property.Name + "=\"" + propertyValue + "\""); } JObject style = contentItem.styles; diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml index afadd3d93e..3a4fa3b8e2 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml @@ -67,10 +67,7 @@ foreach (JProperty property in cfg.Properties()) { var propertyValue = TemplateUtilities.CleanForXss(property.Value.ToString()); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - attrs.Add(property.Name + "=\"" + propertyValue +"\""); - } + attrs.Add(property.Name + "=\"" + propertyValue + "\""); } JObject style = contentItem.styles; diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml index 4a15201997..5a570efdb5 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml @@ -16,6 +16,6 @@ else { -
@TemplateUtilities.CleanForXss(Model.value.ToString())
+
@Model.value
}