alchemy_cms 3.6.3 → 3.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b9e2cce85c52ff12e282cbcd0e4ec72f6b1deb4b
4
- data.tar.gz: 47c0b0562f11648f2b262857034e2f1ecd9e2069
2
+ SHA256:
3
+ metadata.gz: bc38eb1620f05d2aaafa52297a22bb6242829a446e9053173e028f877edac69e
4
+ data.tar.gz: 5d8d89491e025c49c278e18f8d53e0fc9e93ce93122fe4f05206ff6233d16bcc
5
5
  SHA512:
6
- metadata.gz: 264fb1b76ecb285e940f1951d99ea57a53879f6d346d5b050ea96fd74fe2f45e68da13219fac61f532ad102d6600f3ef38bae1bd500ae620a34f0980d10acaa9
7
- data.tar.gz: 6968929958734e0ed852a9b0f182de6b5123445f32a98a24821be2f5ed472eeb883d580c41cfd28ee9c6b5525059df0f596fed0e7e2109f1e47b053f1e0ce737
6
+ metadata.gz: 13e0ce03b2791c0baa8f81a3e23a85db40f67685b9b1326493fcdcd9287588bf26bfef545db394f6b44a1a08c9e1fd786624648b7c0531fb66db88f5034d35e8
7
+ data.tar.gz: 0c85045599a7282c7cf1b80618c78f05f4aff1cd1b2a05381c81163ad35878be6d9dd882976ca1698131c2d13c1e47ff5750ab904f3379fd97ad77b1a8af0c3f
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem 'rack-mini-profiler', group: :development, require: false
7
7
 
8
8
  gem 'sqlite3' if ENV['DB'].nil? || ENV['DB'] == 'sqlite'
9
9
  gem 'mysql2', '~> 0.3.18' if ENV['DB'] == 'mysql'
10
- gem 'pg' if ENV['DB'] == 'postgresql'
10
+ gem 'pg', '~> 0.21' if ENV['DB'] == 'postgresql'
11
11
  gem 'sassc-rails'
12
12
 
13
13
  group :development, :test do
@@ -56,7 +56,7 @@ module Alchemy
56
56
  private
57
57
 
58
58
  def read_yml_file
59
- ::YAML.safe_load(ERB.new(File.read(yml_file_path)).result, [], [], true) || []
59
+ ::YAML.safe_load(ERB.new(File.read(yml_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
60
60
  end
61
61
 
62
62
  def yml_file_path
@@ -26,7 +26,7 @@ module Alchemy
26
26
  #
27
27
  def read_definitions_file
28
28
  if ::File.exist?(definitions_file_path)
29
- ::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, [Regexp, Date], [], true) || []
29
+ ::YAML.safe_load(ERB.new(File.read(definitions_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
30
30
  else
31
31
  raise LoadError, "Could not find elements.yml file! Please run `rails generate alchemy:scaffold`"
32
32
  end
@@ -46,7 +46,8 @@ module Alchemy
46
46
  # If it does not exist, or its empty, it returns an empty Hash.
47
47
  #
48
48
  def read_file(file)
49
- return YAML.load_file(file) || {} if File.exist?(file) # YAML.load_file returns false if file is empty.
49
+ YAML.safe_load(ERB.new(File.read(file)).result, YAML_WHITELIST_CLASSES, [], true) || {}
50
+ rescue Errno::ENOENT
50
51
  {}
51
52
  end
52
53
 
@@ -157,7 +157,7 @@ module Alchemy
157
157
  #
158
158
  def read_definitions_file
159
159
  if File.exist?(layouts_file_path)
160
- YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, [Date], [], true) || []
160
+ YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
161
161
  else
162
162
  raise LoadError, "Could not find page_layouts.yml file! Please run `rails generate alchemy:scaffold`"
163
163
  end
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
- VERSION = "3.6.3"
2
+ VERSION = "3.6.4"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -1,5 +1,6 @@
1
1
  # Instantiate the global Alchemy namespace
2
2
  module Alchemy
3
+ Alchemy::YAML_WHITELIST_CLASSES = %w(Symbol Date Regexp)
3
4
  end
4
5
 
5
6
  # Require globally used external libraries
@@ -32,7 +32,7 @@ module Alchemy
32
32
  end
33
33
 
34
34
  def load_alchemy_yaml(name)
35
- YAML.safe_load(ERB.new(File.read("#{Rails.root}/config/alchemy/#{name}")).result, [Regexp], [], true)
35
+ YAML.safe_load(ERB.new(File.read("#{Rails.root}/config/alchemy/#{name}")).result, YAML_WHITELIST_CLASSES, [], true)
36
36
  rescue Errno::ENOENT
37
37
  puts "\nERROR: Could not read config/alchemy/#{name} file. Please run: rails generate alchemy:scaffold"
38
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.3
4
+ version: 3.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2017-10-24 00:00:00.000000000 Z
16
+ date: 2018-04-23 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -995,7 +995,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
995
995
  requirements:
996
996
  - ImageMagick (libmagick), v6.6 or greater.
997
997
  rubyforge_project:
998
- rubygems_version: 2.6.13
998
+ rubygems_version: 2.7.6
999
999
  signing_key:
1000
1000
  specification_version: 4
1001
1001
  summary: A powerful, userfriendly and flexible CMS for Rails 4