diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 7a261de96..a902ee263 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -232,8 +232,8 @@ namespace BTCPayServer.Controllers InvoiceId = invoice.Id, DefaultLang = storeBlob.DefaultLang ?? "en", HtmlTitle = storeBlob.HtmlTitle ?? "BTCPay Invoice", - CustomCSSLink = storeBlob.CustomCSS?.AbsoluteUri, - CustomLogoLink = storeBlob.CustomLogo?.AbsoluteUri, + CustomCSSLink = storeBlob.CustomCSS, + CustomLogoLink = storeBlob.CustomLogo, CryptoImage = Request.GetRelativePathOrAbsolute(paymentMethodHandler.GetCryptoImage(paymentMethodId)), BtcAddress = paymentMethodDetails.GetPaymentDestination(), BtcDue = accounting.Due.ToString(), diff --git a/BTCPayServer/Controllers/StoresController.cs b/BTCPayServer/Controllers/StoresController.cs index 5b07ac906..e2dc23c58 100644 --- a/BTCPayServer/Controllers/StoresController.cs +++ b/BTCPayServer/Controllers/StoresController.cs @@ -353,8 +353,8 @@ namespace BTCPayServer.Controllers var storeBlob = CurrentStore.GetStoreBlob(); var vm = new CheckoutExperienceViewModel(); SetCryptoCurrencies(vm, CurrentStore); - vm.CustomCSS = storeBlob.CustomCSS?.AbsoluteUri; - vm.CustomLogo = storeBlob.CustomLogo?.AbsoluteUri; + vm.CustomCSS = storeBlob.CustomCSS; + vm.CustomLogo = storeBlob.CustomLogo; vm.HtmlTitle = storeBlob.HtmlTitle; vm.SetLanguages(_LangService, storeBlob.DefaultLang); vm.RequiresRefundEmail = storeBlob.RequiresRefundEmail; @@ -412,8 +412,8 @@ namespace BTCPayServer.Controllers { return View(model); } - blob.CustomLogo = string.IsNullOrWhiteSpace(model.CustomLogo) ? null : new Uri(model.CustomLogo, UriKind.Absolute); - blob.CustomCSS = string.IsNullOrWhiteSpace(model.CustomCSS) ? null : new Uri(model.CustomCSS, UriKind.Absolute); + blob.CustomLogo = model.CustomLogo; + blob.CustomCSS = model.CustomCSS; blob.HtmlTitle = string.IsNullOrWhiteSpace(model.HtmlTitle) ? null : model.HtmlTitle; blob.DefaultLang = model.DefaultLang; blob.RequiresRefundEmail = model.RequiresRefundEmail; diff --git a/BTCPayServer/Data/StoreBlob.cs b/BTCPayServer/Data/StoreBlob.cs index 95ceb8c5b..af3b16469 100644 --- a/BTCPayServer/Data/StoreBlob.cs +++ b/BTCPayServer/Data/StoreBlob.cs @@ -89,10 +89,9 @@ namespace BTCPayServer.Data public CurrencyValue LightningMaxValue { get; set; } public bool LightningAmountInSatoshi { get; set; } - [JsonConverter(typeof(UriJsonConverter))] - public Uri CustomLogo { get; set; } - [JsonConverter(typeof(UriJsonConverter))] - public Uri CustomCSS { get; set; } + public string CustomLogo { get; set; } + + public string CustomCSS { get; set; } public string HtmlTitle { get; set; } public bool RateScripting { get; set; } diff --git a/BTCPayServer/Models/StoreViewModels/CheckoutExperienceViewModel.cs b/BTCPayServer/Models/StoreViewModels/CheckoutExperienceViewModel.cs index c2b6f1a1e..2cddf1742 100644 --- a/BTCPayServer/Models/StoreViewModels/CheckoutExperienceViewModel.cs +++ b/BTCPayServer/Models/StoreViewModels/CheckoutExperienceViewModel.cs @@ -27,10 +27,8 @@ namespace BTCPayServer.Models.StoreViewModels public string DefaultLang { get; set; } [Display(Name = "Link to a custom CSS stylesheet")] - [Uri] public string CustomCSS { get; set; } [Display(Name = "Link to a custom logo")] - [Uri] public string CustomLogo { get; set; } [Display(Name = "Custom HTML title to display on Checkout page")] diff --git a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml index b50dca7c9..be25bd08e 100644 --- a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml @@ -3,7 +3,7 @@
- @if (Model.CustomLogoLink != null) + @if (!string.IsNullOrEmpty(Model.CustomLogoLink)) { } diff --git a/BTCPayServer/Views/Invoice/Checkout.cshtml b/BTCPayServer/Views/Invoice/Checkout.cshtml index 5b32baa72..5789b05f3 100644 --- a/BTCPayServer/Views/Invoice/Checkout.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout.cshtml @@ -24,7 +24,7 @@ - @if (Model.CustomCSSLink != null) + @if (!string.IsNullOrEmpty(Model.CustomCSSLink)) { }