Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
added HTML encoding for the Bundled product item name. (#370)
Nikhil Scaria706de6d8bc9e
diff --git a/src/Business/Grand.Business.Catalog/Services/Products/ProductAttributeFormatter.cs b/src/Business/Grand.Business.Catalog/Services/Products/ProductAttributeFormatter.csindex f362a4f96..ce47258d7 100644--- a/src/Business/Grand.Business.Catalog/Services/Products/ProductAttributeFormatter.cs+++ b/src/Business/Grand.Business.Catalog/Services/Products/ProductAttributeFormatter.cs@@ -94,6 +94,10 @@ namespace Grand.Business.Catalog.Services.Productsif (product.ProductTypeId == ProductType.BundledProduct){var i = 0;+ if (result.Length > 0)+ {+ result.Append(separator);+ }foreach (var bundle in product.BundleProducts){var p1 = await _productService.GetProductById(bundle.ProductId);@@ -101,7 +105,14 @@ namespace Grand.Business.Catalog.Services.Productsif (i > 0)result.Append(separator);- result.Append($"<a href=\"{p1.GetSeName(langId)}\"> {p1.GetTranslation(x => x.Name, langId)} </a>");+ if (htmlEncode)+ {+ result.Append($"<a href=\"{p1.GetSeName(langId)}\"> {WebUtility.HtmlEncode(p1.GetTranslation(x => x.Name, langId))} </a>");+ }+ else+ {+ result.Append($"<a href=\"{p1.GetSeName(langId)}\"> {p1.GetTranslation(x => x.Name, langId)} </a>");+ }var formattedAttribute = await PrepareFormattedAttribute(p1, customAttributes, langId, separator, htmlEncode,renderPrices, allowHyperlinks, showInAdmin);if (formattedAttribute.Length > 0)