Make sure EmbeddedCSS is CSS

This commit is contained in:
nicolas.dorier 2019-08-10 14:53:24 +09:00
parent 039bee5b65
commit 63df6ac5eb
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 4 additions and 6 deletions

View File

@ -88,6 +88,8 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
EmbeddedCSS = blob.EmbeddedCSS;
CustomCSSLink = blob.CustomCSSLink;
AllowCustomPaymentAmounts = blob.AllowCustomPaymentAmounts;
if (!string.IsNullOrEmpty(EmbeddedCSS))
EmbeddedCSS = $"<style>{EmbeddedCSS}</style>";
switch (data.Status)
{
case PaymentRequestData.PaymentRequestStatus.Pending:

View File

@ -31,12 +31,8 @@
}
<bundle name="wwwroot/bundles/payment-request-bundle.min.css"></bundle>
@if (!string.IsNullOrEmpty(Model.EmbeddedCSS))
{
<style>
@Safe.Raw(Model.EmbeddedCSS);
</style>
}
@Safe.Raw(Model.EmbeddedCSS);
</head>
<body>