mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +08:00
Merge pull request #454 from Ducz0r/lm-sci-953-fix
Re-display images & checkboxes in PDF reports [SCI-953]
This commit is contained in:
commit
4deb472dc9
2 changed files with 9 additions and 4 deletions
|
@ -1,9 +1,13 @@
|
||||||
module InputSanitizeHelper
|
module InputSanitizeHelper
|
||||||
def sanitize_input(text)
|
def sanitize_input(
|
||||||
|
text,
|
||||||
|
tags = [],
|
||||||
|
attributes = []
|
||||||
|
)
|
||||||
ActionController::Base.helpers.sanitize(
|
ActionController::Base.helpers.sanitize(
|
||||||
text,
|
text,
|
||||||
tags: Constants::WHITELISTED_TAGS,
|
tags: Constants::WHITELISTED_TAGS + tags,
|
||||||
attributes: Constants::WHITELISTED_ATTRIBUTES
|
attributes: Constants::WHITELISTED_ATTRIBUTES + attributes
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
</head>
|
</head>
|
||||||
<body class="print-report-body">
|
<body class="print-report-body">
|
||||||
<div class="print-report">
|
<div class="print-report">
|
||||||
<%= sanitize_input(@html) %>
|
<% # Also whitelist <img> and <input type="checkbox"> tags %>
|
||||||
|
<%= sanitize_input(@html, ['img', 'input'], ['type', 'disabled', 'checked']) %>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue