mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Re-display images & checkboxes in PDF reports
Closes SCI-953.
This commit is contained in:
parent
042a85af45
commit
0baaf12de3
2 changed files with 9 additions and 4 deletions
|
@ -1,9 +1,13 @@
|
|||
module InputSanitizeHelper
|
||||
def sanitize_input(text)
|
||||
def sanitize_input(
|
||||
text,
|
||||
tags = [],
|
||||
attributes = []
|
||||
)
|
||||
ActionController::Base.helpers.sanitize(
|
||||
text,
|
||||
tags: Constants::WHITELISTED_TAGS,
|
||||
attributes: Constants::WHITELISTED_ATTRIBUTES
|
||||
tags: Constants::WHITELISTED_TAGS + tags,
|
||||
attributes: Constants::WHITELISTED_ATTRIBUTES + attributes
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
</head>
|
||||
<body class="print-report-body">
|
||||
<div class="print-report">
|
||||
<%= sanitize_input(@html) %>
|
||||
<% # Also whitelist <img> and <input type="checkbox"> tags %>
|
||||
<%= sanitize_input(@html, ['img', 'input'], ['type', 'disabled', 'checked']) %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue