mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 13:14:29 +08:00
Merge pull request #707 from ZmagoD/pdf_export
fixes export pdf error on production
This commit is contained in:
commit
77a1848f6d
2 changed files with 9 additions and 1 deletions
|
@ -99,4 +99,12 @@ module ReportsHelper
|
|||
end
|
||||
"<span class=\"label label-#{style}\">#{text}</span>".html_safe
|
||||
end
|
||||
|
||||
def sanitize_report_pdf(text, tags = [], attributes = [])
|
||||
ActionController::Base.helpers.sanitize(
|
||||
text,
|
||||
tags: Constants::WHITELISTED_TAGS + tags,
|
||||
attributes: Constants::WHITELISTED_ATTRIBUTES + attributes
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<body class="print-report-body">
|
||||
<div class="print-report">
|
||||
<% # Also whitelist <img> and <input type="checkbox"> tags %>
|
||||
<%= sanitize_input(@html, ['img', 'input'], ['type', 'disabled', 'checked']) %>
|
||||
<%= sanitize_report_pdf(@html, ['img', 'input'], ['type', 'disabled', 'checked']) %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue