diff --git a/VERSION b/VERSION index 6ee34ec94..1e1c526f5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.28.0.1 +1.28.0.2 diff --git a/app/helpers/input_sanitize_helper.rb b/app/helpers/input_sanitize_helper.rb index 8b801886b..2dfc2ae00 100644 --- a/app/helpers/input_sanitize_helper.rb +++ b/app/helpers/input_sanitize_helper.rb @@ -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 diff --git a/app/javascript/packs/tiny_mce.js b/app/javascript/packs/tiny_mce.js index 87bce78b3..fd80d426e 100644 --- a/app/javascript/packs/tiny_mce.js +++ b/app/javascript/packs/tiny_mce.js @@ -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 diff --git a/app/views/reports/elements/_my_module_element.html.erb b/app/views/reports/elements/_my_module_element.html.erb index 00d97ea18..47b57d1a5 100644 --- a/app/views/reports/elements/_my_module_element.html.erb +++ b/app/views/reports/elements/_my_module_element.html.erb @@ -60,7 +60,7 @@