mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:52:44 +08:00
FIX: properly escape embed url
This commit is contained in:
parent
e0bc82657b
commit
6c8069c65a
|
@ -209,7 +209,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||||
|
|
||||||
def self.topic_id_for_embed(embed_url)
|
def self.topic_id_for_embed(embed_url)
|
||||||
embed_url = normalize_url(embed_url).sub(/^https?\:\/\//, '')
|
embed_url = normalize_url(embed_url).sub(/^https?\:\/\//, '')
|
||||||
TopicEmbed.where("embed_url ~* '^https?://#{Regexp.escape(embed_url)}$'").pluck(:topic_id).first
|
TopicEmbed.where("embed_url ~* ?", "^https?://#{Regexp.escape(embed_url)}$").pluck(:topic_id).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.first_paragraph_from(html)
|
def self.first_paragraph_from(html)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user