mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 08:35:20 +08:00
FIX: don't validate and render the polls inside a quoted post. (#15019)
Previously, we had issues while approving posts since we validated the polls inside quotes.
This commit is contained in:
@ -286,6 +286,7 @@ class DiscoursePoll::Poll
|
||||
def self.extract(raw, topic_id, user_id = nil)
|
||||
# TODO: we should fix the callback mess so that the cooked version is available
|
||||
# in the validators instead of cooking twice
|
||||
raw = raw.sub(/\[quote.+\/quote\]/m, '')
|
||||
cooked = PrettyText.cook(raw, topic_id: topic_id, user_id: user_id)
|
||||
|
||||
Nokogiri::HTML5(cooked).css("div.poll").map do |p|
|
||||
|
Reference in New Issue
Block a user