mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Display payment method literally
Don't allow for HTML and potentially bad scripts. But this also prevents accidental display errors. If someone wrote, "We only take <cash>", it would mess with the site.
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
.pad
|
||||
.text-big
|
||||
= t :order_payment
|
||||
%strong= order.payments.first.andand.payment_method.andand.name.andand.html_safe
|
||||
%strong= order.payments.first.andand.payment_method.andand.name
|
||||
%p.text-small.text-skinny.pre-line
|
||||
%em= order.payments.first.andand.payment_method.andand.description.andand.html_safe
|
||||
%em= order.payments.first.andand.payment_method.andand.description
|
||||
|
||||
.order-summary.text-small
|
||||
%strong
|
||||
|
||||
@@ -21,4 +21,12 @@ describe "spree/shared/_order_details.html.haml" do
|
||||
|
||||
expect(rendered).to have_content("Paying via: Bartering")
|
||||
end
|
||||
|
||||
it "displays payment methods safely" do
|
||||
order.payments.first.payment_method.name = "Bar<script>evil</script>ter→ing"
|
||||
|
||||
render
|
||||
|
||||
expect(rendered).to have_content("Paying via: Bar<script>evil</script>ter→ing")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user