SECURITY: XSS in poll errors dialog
This commit is contained in:
parent
e448cbf6ad
commit
c6143ba990
@ -217,7 +217,7 @@ after_initialize do
|
||||
if polls.has_key?(poll["name"])
|
||||
poll["name"] == DEFAULT_POLL_NAME ?
|
||||
self.errors.add(:base, I18n.t("poll.multiple_polls_without_name")) :
|
||||
self.errors.add(:base, I18n.t("poll.multiple_polls_with_same_name", name: poll["name"]))
|
||||
self.errors.add(:base, I18n.t("poll.multiple_polls_with_same_name", name: ERB::Util.html_escape(poll["name"])))
|
||||
return
|
||||
end
|
||||
|
||||
@ -225,7 +225,7 @@ after_initialize do
|
||||
if poll["options"].map { |o| o["id"] }.uniq.size != poll["options"].size
|
||||
poll["name"] == DEFAULT_POLL_NAME ?
|
||||
self.errors.add(:base, I18n.t("poll.default_poll_must_have_different_options")) :
|
||||
self.errors.add(:base, I18n.t("poll.named_poll_must_have_different_options", name: poll["name"]))
|
||||
self.errors.add(:base, I18n.t("poll.named_poll_must_have_different_options", name: ERB::Util.html_escape(poll["name"])))
|
||||
return
|
||||
end
|
||||
|
||||
@ -233,7 +233,7 @@ after_initialize do
|
||||
if poll["options"].size < 2
|
||||
poll["name"] == DEFAULT_POLL_NAME ?
|
||||
self.errors.add(:base, I18n.t("poll.default_poll_must_have_at_least_2_options")) :
|
||||
self.errors.add(:base, I18n.t("poll.named_poll_must_have_at_least_2_options", name: poll["name"]))
|
||||
self.errors.add(:base, I18n.t("poll.named_poll_must_have_at_least_2_options", name: ERB::Util.html_escape(poll["name"])))
|
||||
return
|
||||
end
|
||||
|
||||
@ -241,7 +241,7 @@ after_initialize do
|
||||
if poll["options"].size > SiteSetting.poll_maximum_options
|
||||
poll["name"] == DEFAULT_POLL_NAME ?
|
||||
self.errors.add(:base, I18n.t("poll.default_poll_must_have_less_options", max: SiteSetting.poll_maximum_options)) :
|
||||
self.errors.add(:base, I18n.t("poll.named_poll_must_have_less_options", name: poll["name"], max: SiteSetting.poll_maximum_options))
|
||||
self.errors.add(:base, I18n.t("poll.named_poll_must_have_less_options", name: ERB::Util.html_escape(poll["name"]), max: SiteSetting.poll_maximum_options))
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user