mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 08:01:01 +08:00
FIX: Allow Safe Redirections in Topic Embedding
This commit is contained in:
parent
596fcfeb58
commit
cd571b26ba
|
@ -81,7 +81,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||||
embed_classname_whitelist = SiteSetting.embed_classname_whitelist if SiteSetting.embed_classname_whitelist.present?
|
embed_classname_whitelist = SiteSetting.embed_classname_whitelist if SiteSetting.embed_classname_whitelist.present?
|
||||||
|
|
||||||
response = FetchResponse.new
|
response = FetchResponse.new
|
||||||
html = open(url).read
|
html = open(url, allow_redirections: :safe).read
|
||||||
|
|
||||||
raw_doc = Nokogiri::HTML(html)
|
raw_doc = Nokogiri::HTML(html)
|
||||||
auth_element = raw_doc.at('meta[@name="author"]')
|
auth_element = raw_doc.at('meta[@name="author"]')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user