camaleon_cms 2.8.1 → 2.8.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/camaleon_cms/admin/_actions.js +3 -2
  3. data/app/assets/javascripts/camaleon_cms/admin/_libraries.js +0 -1
  4. data/app/assets/javascripts/camaleon_cms/admin/admin-manifest.js +1 -2
  5. data/app/assets/javascripts/camaleon_cms/admin/introjs/intro.min.js +11 -0
  6. data/app/assets/javascripts/camaleon_cms/admin/introjs/intro.min.js.map +1 -0
  7. data/app/assets/javascripts/camaleon_cms/admin/jquery.validate.js +5 -5
  8. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_ar.js +52 -0
  9. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_de.js +70 -0
  10. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{es.js → messages_es.js} +9 -10
  11. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{fr.js → messages_fr.js} +7 -3
  12. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_it.js +27 -0
  13. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{nl.js → messages_nl.js} +1 -0
  14. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{pt-BR.js → messages_pt-BR.js} +24 -19
  15. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{ru.js → messages_ru.js} +6 -2
  16. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{zh-CN.js → messages_zh-CN.js} +9 -8
  17. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/methods_de.js +12 -0
  18. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/methods_nl.js +12 -0
  19. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/methods_pt.js +9 -0
  20. data/app/assets/javascripts/camaleon_cms/admin/lte/app.js +71 -57
  21. data/app/assets/stylesheets/camaleon_cms/admin/_custom_admin.css.scss +19 -7
  22. data/app/assets/stylesheets/camaleon_cms/admin/admin-manifest.css +1 -1
  23. data/app/assets/stylesheets/camaleon_cms/admin/introjs/introjs.min.css +2 -0
  24. data/app/assets/stylesheets/camaleon_cms/admin/introjs/introjs.min.css.map +1 -0
  25. data/app/assets/stylesheets/camaleon_cms/admin/lte/_admin.css.scss +450 -69
  26. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-black-light.css +15 -18
  27. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-black.css +22 -18
  28. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-blue-light.css +0 -3
  29. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-blue.css +1 -4
  30. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-green-light.css +0 -3
  31. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-green.css +0 -3
  32. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-purple-light.css +0 -3
  33. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-purple.css +0 -4
  34. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-red-light.css +0 -3
  35. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-red.css +0 -3
  36. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-yellow-light.css +0 -3
  37. data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-yellow.css +0 -3
  38. data/app/assets/stylesheets/camaleon_cms/bootstrap.min.css.map +1 -0
  39. data/app/controllers/camaleon_cms/admin/media_controller.rb +2 -1
  40. data/app/helpers/camaleon_cms/uploader_helper.rb +1 -1
  41. data/app/models/camaleon_cms/term_taxonomy.rb +13 -2
  42. data/app/uploaders/camaleon_cms_aws_uploader.rb +2 -0
  43. data/app/uploaders/camaleon_cms_local_uploader.rb +3 -1
  44. data/app/uploaders/camaleon_cms_uploader.rb +2 -4
  45. data/app/views/layouts/camaleon_cms/admin.html.erb +7 -1
  46. data/lib/camaleon_cms/version.rb +1 -1
  47. metadata +21 -15
  48. data/app/assets/javascripts/camaleon_cms/admin/_underscore.js +0 -1536
  49. data/app/assets/javascripts/camaleon_cms/admin/introjs/_intro.min.js +0 -1317
  50. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/de.js +0 -20
  51. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/it.js +0 -23
  52. data/app/assets/stylesheets/camaleon_cms/admin/introjs/_introjs.min.css +0 -1
  53. /data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/{uk.js → messages_uk.js} +0 -0
@@ -57,7 +57,8 @@ module CamaleonCms
57
57
  case params[:media_action]
58
58
  when 'new_folder'
59
59
  params[:folder] = slugify_folder(params[:folder])
60
- return render partial: 'render_file_item', locals: { files: [cama_uploader.add_folder(params[:folder])] }
60
+ r = cama_uploader.add_folder(params[:folder])
61
+ return render partial: 'render_file_item', locals: { files: [r] } if r[:error].blank?
61
62
  when 'del_folder'
62
63
  r = cama_uploader.delete_folder(params[:folder])
63
64
  when 'del_file'
@@ -76,7 +76,7 @@ module CamaleonCms
76
76
  res = { error: nil }
77
77
 
78
78
  # guard against path traversal
79
- return { error: 'Invalid file path' } unless cama_uploader.class.valid_folder_path?(settings[:folder])
79
+ return { error: 'Invalid file path' } unless cama_uploader.valid_folder_path?(settings[:folder])
80
80
 
81
81
  # formats validations
82
82
  return { error: "#{ct('file_format_error')} (#{settings[:formats]})" } unless cama_uploader.class.validate_file_format(
@@ -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
@@ -105,6 +105,8 @@ class CamaleonCmsAwsUploader < CamaleonCmsUploader
105
105
 
106
106
  # add new folder to AWS with :key
107
107
  def add_folder(key)
108
+ return { error: 'Invalid folder path' } unless valid_folder_path?(key)
109
+
108
110
  key = "#{@aws_settings['inner_folder']}/#{key}" if @aws_settings['inner_folder'].present?
109
111
  key = key.cama_fix_media_key
110
112
  s3_file = bucket.object(key.slice(1..-1) << '/')
@@ -25,7 +25,7 @@ class CamaleonCmsLocalUploader < CamaleonCmsUploader
25
25
  end
26
26
 
27
27
  def fetch_file(file_name)
28
- return { error: 'Invalid file path' } if file_name.include?('..')
28
+ return { error: 'Invalid file path' } unless valid_folder_path?(file_name)
29
29
 
30
30
  return file_name if file_exists?(file_name)
31
31
 
@@ -96,6 +96,8 @@ class CamaleonCmsLocalUploader < CamaleonCmsUploader
96
96
 
97
97
  # create a new folder into local directory
98
98
  def add_folder(key)
99
+ return { error: 'Invalid folder path' } unless valid_folder_path?(key)
100
+
99
101
  d = File.join(@root_folder, key).to_s
100
102
  is_new_folder = false
101
103
  unless Dir.exist?(d)
@@ -125,10 +125,8 @@ class CamaleonCmsUploader
125
125
  valid_formats.include?(File.extname(key).sub('.', '').split('?').first.try(:downcase))
126
126
  end
127
127
 
128
- def self.valid_folder_path?(path)
129
- return true if path == '/'
130
-
131
- return false if path.include?('..') || File.absolute_path?(path) || path.include?('://')
128
+ def valid_folder_path?(path)
129
+ return false if path.include?('..') || path.include?('://')
132
130
 
133
131
  true
134
132
  end
@@ -18,7 +18,13 @@
18
18
  </script>
19
19
  <%= javascript_include_tag "camaleon_cms/admin/admin-manifest" %>
20
20
 
21
- <%= javascript_include_tag "camaleon_cms/admin/jquery_validate/#{current_locale}.js" if current_locale != 'en' %>
21
+ <%= javascript_include_tag "camaleon_cms/admin/jquery_validate/messages_#{current_locale}.js" if current_locale != 'en' %>
22
+
23
+ <% jquery_validate_localized_methods = "camaleon_cms/admin/jquery_validate/methods_#{current_locale}.js"%>
24
+ <% jquery_validate_localized_methods_exist =
25
+ File.file?(Rails.root.join('app', 'assets', 'javascripts', jquery_validate_localized_methods))%>
26
+ <%= javascript_include_tag jquery_validate_localized_methods if jquery_validate_localized_methods_exist %>
27
+
22
28
  <%= javascript_include_tag "camaleon_cms/admin/momentjs/#{current_locale}.js" if current_locale != 'en' %>
23
29
 
24
30
  <%= raw the_head({}, false) %>
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = '2.8.1'.freeze
2
+ VERSION = '2.8.3'.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.3
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-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -582,25 +582,29 @@ files:
582
582
  - app/assets/javascripts/camaleon_cms/admin/_post.js
583
583
  - app/assets/javascripts/camaleon_cms/admin/_posttype.js
584
584
  - app/assets/javascripts/camaleon_cms/admin/_translator.js
585
- - app/assets/javascripts/camaleon_cms/admin/_underscore.js
586
585
  - app/assets/javascripts/camaleon_cms/admin/_user_profile.js
587
586
  - app/assets/javascripts/camaleon_cms/admin/admin-basic-manifest.js
588
587
  - app/assets/javascripts/camaleon_cms/admin/admin-manifest.js
589
588
  - app/assets/javascripts/camaleon_cms/admin/bootstrap-colorpicker.js
590
589
  - app/assets/javascripts/camaleon_cms/admin/custom_fields_form.js
591
- - app/assets/javascripts/camaleon_cms/admin/introjs/_intro.min.js
590
+ - app/assets/javascripts/camaleon_cms/admin/introjs/intro.min.js
591
+ - app/assets/javascripts/camaleon_cms/admin/introjs/intro.min.js.map
592
592
  - app/assets/javascripts/camaleon_cms/admin/jquery-sieve.js
593
593
  - app/assets/javascripts/camaleon_cms/admin/jquery.nestable.js
594
594
  - app/assets/javascripts/camaleon_cms/admin/jquery.validate.js
595
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/de.js
596
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/es.js
597
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/fr.js
598
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/it.js
599
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/nl.js
600
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/pt-BR.js
601
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/ru.js
602
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/uk.js
603
- - app/assets/javascripts/camaleon_cms/admin/jquery_validate/zh-CN.js
595
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_ar.js
596
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_de.js
597
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_es.js
598
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_fr.js
599
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_it.js
600
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_nl.js
601
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_pt-BR.js
602
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_ru.js
603
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_uk.js
604
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/messages_zh-CN.js
605
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/methods_de.js
606
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/methods_nl.js
607
+ - app/assets/javascripts/camaleon_cms/admin/jquery_validate/methods_pt.js
604
608
  - app/assets/javascripts/camaleon_cms/admin/lte/app.js
605
609
  - app/assets/javascripts/camaleon_cms/admin/momentjs/_moment.js
606
610
  - app/assets/javascripts/camaleon_cms/admin/momentjs/ar.js
@@ -657,7 +661,8 @@ files:
657
661
  - app/assets/stylesheets/camaleon_cms/admin/img/no_image.jpg
658
662
  - app/assets/stylesheets/camaleon_cms/admin/img/rormeleon-white.png
659
663
  - app/assets/stylesheets/camaleon_cms/admin/img/thumb_no_found.jpg
660
- - app/assets/stylesheets/camaleon_cms/admin/introjs/_introjs.min.css
664
+ - app/assets/stylesheets/camaleon_cms/admin/introjs/introjs.min.css
665
+ - app/assets/stylesheets/camaleon_cms/admin/introjs/introjs.min.css.map
661
666
  - app/assets/stylesheets/camaleon_cms/admin/jquery/_jquery-ui.scss
662
667
  - app/assets/stylesheets/camaleon_cms/admin/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png
663
668
  - app/assets/stylesheets/camaleon_cms/admin/jquery/images/ui-bg_flat_75_ffffff_40x100.png
@@ -692,6 +697,7 @@ files:
692
697
  - app/assets/stylesheets/camaleon_cms/admin/uploader/uploader_manifest.css
693
698
  - app/assets/stylesheets/camaleon_cms/admin/widgets.css.scss
694
699
  - app/assets/stylesheets/camaleon_cms/bootstrap.min.css
700
+ - app/assets/stylesheets/camaleon_cms/bootstrap.min.css.map
695
701
  - app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot
696
702
  - app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg
697
703
  - app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf
@@ -1146,7 +1152,7 @@ requirements:
1146
1152
  - rails >= 6.1
1147
1153
  - ruby >= 3.0
1148
1154
  - imagemagick
1149
- rubygems_version: 3.5.11
1155
+ rubygems_version: 3.5.18
1150
1156
  signing_key:
1151
1157
  specification_version: 4
1152
1158
  summary: Camaleon is a CMS for Ruby on Rails as an alternative to Wordpress.