camaleon_cms 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

@@ -3,6 +3,12 @@ module CamaleonCms
3
3
  include CamaleonCms::Metas
4
4
  include CamaleonCms::CustomFieldsRead
5
5
 
6
+ TRANSLATION_TAG_HIDE_MAP = { '<!--' => '!--', '-->' => '--!' }.freeze
7
+ TRANSLATION_TAG_HIDE_REGEX = Regexp.new(TRANSLATION_TAG_HIDE_MAP.keys.map { |x| Regexp.escape(x) }.join('|')).freeze
8
+ TRANSLATION_TAG_RESTORE_MAP = { '--!' => '-->', '!--' => '<!--' }.freeze
9
+ TRANSLATION_TAG_RESTORE_REGEX =
10
+ Regexp.new(TRANSLATION_TAG_RESTORE_MAP.keys.map { |x| Regexp.escape(x) }.join('|')).freeze
11
+
6
12
  def self.inherited(subclass)
7
13
  super
8
14
 
@@ -22,11 +28,16 @@ module CamaleonCms
22
28
  %i[name description].each do |attr|
23
29
  next unless new_record? || attribute_changed?(attr)
24
30
 
25
- self[attr] = ActionController::Base.helpers.sanitize(__send__(attr))
31
+ self[attr] = ActionController::Base.helpers.sanitize(
32
+ __send__(attr)&.gsub(TRANSLATION_TAG_HIDE_REGEX, TRANSLATION_TAG_HIDE_MAP)
33
+ )&.gsub(TRANSLATION_TAG_RESTORE_REGEX, TRANSLATION_TAG_RESTORE_MAP)
26
34
  end
27
35
  end
28
36
  else
29
- normalizes :name, :description, with: ->(field) { ActionController::Base.helpers.sanitize(field) }
37
+ normalizes :name, :description, with: lambda { |field|
38
+ ActionController::Base.helpers.sanitize(field.gsub(TRANSLATION_TAG_HIDE_REGEX, TRANSLATION_TAG_HIDE_MAP))
39
+ .gsub(TRANSLATION_TAG_RESTORE_REGEX, TRANSLATION_TAG_RESTORE_MAP)
40
+ }
30
41
  end
31
42
 
32
43
  # callbacks
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = '2.8.1'.freeze
2
+ VERSION = '2.8.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camaleon_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-21 00:00:00.000000000 Z
11
+ date: 2024-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -692,6 +692,7 @@ files:
692
692
  - app/assets/stylesheets/camaleon_cms/admin/uploader/uploader_manifest.css
693
693
  - app/assets/stylesheets/camaleon_cms/admin/widgets.css.scss
694
694
  - app/assets/stylesheets/camaleon_cms/bootstrap.min.css
695
+ - app/assets/stylesheets/camaleon_cms/bootstrap.min.css.map
695
696
  - app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot
696
697
  - app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg
697
698
  - app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf