Skip to content

Commit 6ee34af

Browse files
committed
fix: escape html on index pages
1 parent 38b3777 commit 6ee34af

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/pact_broker/ui/views/index/show-with-tags.haml

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,30 @@
3737
%tr
3838
%td.consumer
3939
%a{:href => index_item.consumer_group_url }
40-
= index_item.consumer_name
40+
= escape_html(index_item.consumer_name)
4141
%td.consumer-version-number
4242
%div
43-
= index_item.consumer_version_number
43+
= escape_html(index_item.consumer_version_number)
4444
- if index_item.latest?
4545
.tag.label.label-success
4646
latest
4747
- index_item.consumer_version_latest_tag_names.each do | tag_name |
4848
.tag.label.label-primary
49-
= tag_name
49+
= escape_html(tag_name)
5050
%td.pact
5151
%span.pact
5252
%a{ href: index_item.pact_url, title: "View pact" }
5353
%span.pact-matrix
5454
%a{ href: index_item.pact_matrix_url, title: "View pact matrix" }
5555
%td.provider
5656
%a{ href: index_item.provider_group_url }
57-
= index_item.provider_name
57+
= escape_html(index_item.provider_name)
5858
%td.provider-version-number
5959
%div
60-
= index_item.provider_version_number
60+
= escape_html(index_item.provider_version_number)
6161
- index_item.provider_version_latest_tag_names.each do | tag_name |
6262
.tag.label.label-primary
63-
= tag_name
63+
= escape_html(tag_name)
6464
%td
6565
= index_item.publication_date_of_latest_pact.gsub("about ", "")
6666
%td{ class: index_item.webhook_status }

lib/pact_broker/ui/views/index/show.haml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
%td
3434
%td.consumer
3535
%a{ href: index_item.consumer_group_url }
36-
= index_item.consumer_name
36+
= escape_html(index_item.consumer_name)
3737
%td.pact
3838
%span.pact
3939
%a{ href: index_item.latest_pact_url, :title => "View pact" }
4040
%span.pact-matrix
4141
%a{ href: index_item.pact_matrix_url, title: "View pact matrix" }
4242
%td.provider
4343
%a{ href: index_item.provider_group_url }
44-
= index_item.provider_name
44+
= escape_html(index_item.provider_name)
4545
%td
4646
%td
4747
= index_item.publication_date_of_latest_pact

0 commit comments

Comments
 (0)