mirror of
https://github.com/postalserver/postal.git
synced 2026-10-19 18:56:05 +00:00
fix(deliveries): escape delivery details to prevent HTML injection
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
|
||||||
def format_delivery_details(server, text)
|
def format_delivery_details(server, text)
|
||||||
|
text = h(text)
|
||||||
text.gsub!(/<msg:(\d+)>/) do
|
text.gsub!(/<msg:(\d+)>/) do
|
||||||
id = ::Regexp.last_match(1).to_i
|
id = ::Regexp.last_match(1).to_i
|
||||||
link_to("message ##{id}", organization_server_message_path(server.organization, server, id), class: "u-link")
|
link_to("message ##{id}", organization_server_message_path(server.organization, server, id), class: "u-link")
|
||||||
|
|||||||
Reference in New Issue
Block a user