fix for rails security advisory CVE-2016-6316

have to backport for rails 4.0

Change-Id: I3eef6b53bbbd5791109af28e8f8c5467332c7d22
Reviewed-on: https://gerrit.instructure.com/87527
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2016-08-11 12:01:27 -06:00
parent bff69a3f00
commit 747fef8352
1 changed files with 11 additions and 0 deletions

View File

@ -18,3 +18,14 @@ ActiveRecord::LogSubscriber.class_eval do
end
alias_method_chain :sql, :tag
end
if CANVAS_RAILS4_0
# CVE-2016-6316
ActionView::Helpers::TagHelper.module_eval do
def tag_option(key, value, escape)
value = value.join(" ") if value.is_a?(Array)
value = ERB::Util.h(value) if escape
%(#{key}="#{value.gsub(/"/, '&quot;'.freeze)}")
end
end
end