Merge pull request #6100 from scinote-eln/hotfix/1.28.0.2

Hotfix/1.28.0.2
This commit is contained in:
artoscinote 2023-08-29 16:31:04 +02:00 committed by GitHub
commit ffb8c7c455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 10 deletions

View file

@ -1 +1 @@
1.28.0.1
1.28.0.2

View file

@ -4,8 +4,8 @@ require 'sanitize'
require 'cgi'
module InputSanitizeHelper
def sanitize_input(html, _tags = [], _attributes = [])
Sanitize.fragment(html, Constants::INPUT_SANITIZE_CONFIG).html_safe
def sanitize_input(html, _tags = [], _attributes = [], sanitizer_config: Constants::INPUT_SANITIZE_CONFIG)
Sanitize.fragment(html, sanitizer_config).html_safe
end
def escape_input(text)
@ -33,7 +33,12 @@ module InputSanitizeHelper
format_opt = wrapper_tag.merge(sanitize: false)
base64_encoded_imgs = options.fetch(:base64_encoded_imgs, false)
text = simple_format(text, {}, format_opt) if simple_f
text = sanitize_input(text, tags)
# allow base64 images when sanitizing if base64_encoded_imgs is true
sanitizer_config = Constants::INPUT_SANITIZE_CONFIG.deep_dup
sanitizer_config[:protocols]['img']['src'] << 'data' if options.fetch(:base64_encoded_imgs, false)
text = sanitize_input(text, tags, sanitizer_config: sanitizer_config)
if text =~ SmartAnnotations::TagToHtml::USER_REGEX || text =~ SmartAnnotations::TagToHtml::REGEX
text = smart_annotation_parser(text, team, base64_encoded_imgs, preview_repository)
end

View file

@ -195,11 +195,12 @@ window.TinyMCE = (() => {
document.location.hash = `${textAreaObject.data('objectType')}_${textAreaObject.data('objectId')}`;
}
if ($('.navbar-secondary').length) {
editorToolbaroffset = $('.navbar-secondary').position().top + $('.navbar-secondary').height();
} else if ($('#main-nav').length) {
editorToolbaroffset = $('#main-nav').height();
}
let topMenuHeight = $('.sci--navigation--top-menu-container') ? $('.sci--navigation--top-menu-container').height() : 0;
let breadcrumbsHeight = $('.sci--layout-navigation-breadcrumbs') ? $('.sci--layout-navigation-breadcrumbs').height() : 0;
let secondaryNavHeight = $('.content-header.sticky-header') ? $('.content-header.sticky-header').height() : 0;
editorToolbaroffset = topMenuHeight + breadcrumbsHeight + secondaryNavHeight;
return tinyMCE.init({
cache_suffix: '?v=6.5.1-19', // This suffix should be changed any time library is updated

View file

@ -60,7 +60,7 @@
</div>
</div>
<div class="report-element-children">
<%= render partial: 'reports/elements/my_module_protocol_element', locals: { protocol: my_module.protocol } %>
<%= render partial: 'reports/elements/my_module_protocol_element', locals: { protocol: my_module.protocol, export_all: export_all } %>
<% filter_steps_for_report(my_module.protocol.steps, @settings).order(:position).each do |step| %>
<%= render partial: 'reports/elements/my_module_step_element', locals: { step: step, export_all: export_all } %>