提交 5d5e34fa 编写于 作者: M Michael Koziarski

Use ERB::Util.h over CGI.escapeHTML as the former is safety aware and the latter isn't

上级 1b3195b6
......@@ -16,7 +16,7 @@ def redirect_to(url, status) #:doc:
logger.info("Redirected to #{url}") if logger && logger.info?
self.status = status
self.location = url.gsub(/[\r\n]/, '')
self.response_body = "<html><body>You are being <a href=\"#{CGI.escapeHTML(url)}\">redirected</a>.</body></html>"
self.response_body = "<html><body>You are being <a href=\"#{ERB::Util.h(url)}\">redirected</a>.</body></html>"
end
end
end
......@@ -5,7 +5,7 @@ def <<(value)
if value.html_safe?
super(value)
else
super(CGI.escapeHTML(value))
super(ERB::Util.h(value))
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册