FIX: Don't add a slug to constructed quote urls (#12052)

A topic with the slug 'topic' might exist and may end up being linked to
by mistake when malformed (i.e. cross-site) quotes are posted.
This commit is contained in:
Daniel Waterworth
2021-02-11 12:21:13 -06:00
committed by GitHub
parent 578f753a13
commit df8436cd7f
2 changed files with 4 additions and 4 deletions

View File

@@ -333,7 +333,7 @@ module PrettyText
# extract quotes
doc.css("aside.quote[data-topic]").each do |aside|
if aside["data-topic"].present?
url = +"/t/topic/#{aside["data-topic"]}"
url = +"/t/#{aside["data-topic"]}"
url << "/#{aside["data-post"]}" if aside["data-post"].present?
links << DetectedLink.new(url, true)
end