diff --git a/BTCPayServer.Abstractions/Services/Safe.cs b/BTCPayServer.Abstractions/Services/Safe.cs index cb8a22d82..88d0d2c50 100644 --- a/BTCPayServer.Abstractions/Services/Safe.cs +++ b/BTCPayServer.Abstractions/Services/Safe.cs @@ -22,6 +22,7 @@ namespace BTCPayServer.Abstractions.Services { return _htmlHelper.Raw(_htmlSanitizer.Sanitize(value)); } + public IHtmlContent RawEncode(string value) { return _htmlHelper.Raw(HttpUtility.HtmlEncode(_htmlSanitizer.Sanitize(value))); diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 1d16dca03..b5a29351d 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -988,14 +988,14 @@ namespace BTCPayServer.Tests Assert.True(s.Driver.PageSource.Contains("Tea shop"), "Unable to create PoS"); Assert.True(s.Driver.PageSource.Contains("Cart"), "PoS not showing correct default view"); Assert.True(s.Driver.PageSource.Contains("Take my money"), "PoS not showing correct default view"); - Assert.Equal(6, s.Driver.FindElements(By.CssSelector(".posItem:not(.d-none)")).Count); + Assert.Equal(6, s.Driver.FindElements(By.CssSelector(".posItem.posItem--displayed")).Count); var drinks = s.Driver.FindElement(By.CssSelector("label[for='Category-Drinks']")); Assert.Equal("Drinks", drinks.Text); drinks.Click(); - Assert.Single(s.Driver.FindElements(By.CssSelector(".posItem:not(.d-none)"))); + Assert.Single(s.Driver.FindElements(By.CssSelector(".posItem.posItem--displayed"))); s.Driver.FindElement(By.CssSelector("label[for='Category-*']")).Click(); - Assert.Equal(6, s.Driver.FindElements(By.CssSelector(".posItem:not(.d-none)")).Count); + Assert.Equal(6, s.Driver.FindElements(By.CssSelector(".posItem.posItem--displayed")).Count); s.Driver.Url = posBaseUrl + "/static"; Assert.False(s.Driver.PageSource.Contains("Cart"), "Static PoS not showing correct view"); diff --git a/BTCPayServer/Views/Shared/PointOfSale/Public/Cart.cshtml b/BTCPayServer/Views/Shared/PointOfSale/Public/Cart.cshtml index 68e3294c2..0d081734d 100644 --- a/BTCPayServer/Views/Shared/PointOfSale/Public/Cart.cshtml +++ b/BTCPayServer/Views/Shared/PointOfSale/Public/Cart.cshtml @@ -64,14 +64,14 @@ : item.BuyButtonText; buttonText = buttonText.Replace("{0}", formatted).Replace("{Price}", formatted); var categories = new JArray(item.Categories ?? new object[] { }); -
@Safe.RawEncode(item.Description)
+@Safe.Raw(item.Description)
}