1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

fix: unescape in URLs which are stored for tracking

closes #2568
closes #907
closes #115
هذا الالتزام موجود في:
Adam Cooke
2024-03-04 16:52:36 +00:00
الأصل 658aa71483
التزام 1da1182c23
2 ملفات معدلة مع 3 إضافات و2 حذوفات

عرض الملف

@@ -118,7 +118,8 @@ module Postal
part.gsub!(/href=(['"])(#{URL_REGEX})['"]/) do
if track_domain?($~[:domain])
@tracked_links += 1
token = @message.create_link($~[:url])
url = CGI.unescapeHTML($~[:url])
token = @message.create_link(url)
"href='#{domain}/#{@message.server.token}/#{token}'"
else
::Regexp.last_match(0)

عرض الملف

@@ -36,7 +36,7 @@ mail.html_part = Mail::Part.new do
<p>Hello there</p>
<p>This is an example email. It doesn't do all that much.</p>
<p>Some other characters: őúéáűí</p>
<p>There is a <a href='https://postalserver.io/test-plain-text-link?foo=bar&baz=qux'>link here</a> though...</p>
<p>There is a <a href='https://postalserver.io/test-plain-text-link?foo=bar&amp;baz=qux'>link here</a> though...</p>
BODY
end