Merge pull request #1243 from cniedzwiedz/squash_test

Fixed XSS in markdown() method
This commit is contained in:
Christian Bruckmayer 2017-03-02 14:01:51 +01:00 committed by GitHub
commit ff65b3b601
7 changed files with 61 additions and 1 deletions

View file

@ -295,7 +295,7 @@ module ApplicationHelper
space_after_headers: true,
no_intra_emphasis: true
}
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(escape_html: true), options)
markdown.render(text).html_safe
end