mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:45:26 +08:00
FIX: Stop secure media URLs being censored too liberally in emails (#8817)
For example /t/ URLs were being replaced if they contained secure-media-uploads so if you made a topic called "Secure Media Uploads Are Cool" the View Topic link in the user notifications would be stripped out. Refactored code so this secure URL detection happens in one place.
This commit is contained in:
@ -212,6 +212,10 @@ describe Email::Styles do
|
||||
expect(frag.at('p.secure-media-notice')).to be_present
|
||||
expect(frag.at('img')).not_to be_present
|
||||
end
|
||||
end
|
||||
|
||||
it "does not replace topic links with secure-media-uploads in the name" do
|
||||
frag = html_fragment("<a href=\"#{Discourse.base_url}\/t/secure-media-uploads/235723\">Visit Topic</a>")
|
||||
expect(frag.at('p.secure-media-notice')).not_to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user