Skip to content

Commit

Permalink
Merge pull request #8425 from jhass/8424_fix_yaml_load
Browse files Browse the repository at this point in the history
Use YAML.unsafe_load_file when available in bundler helper
  • Loading branch information
SuperTux88 committed Jun 11, 2023
2 parents 7ce4309 + 324851e commit 9cdfd3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We recommend setting up new pods using Ruby 3.0, and updating existing pods to t
* Drop `strip_exif` flag and always remove exif data from uploaded images [#8417](https://github.com/diaspora/diaspora/pull/8417)
* Replace `apparition` with `cuprite` [#8418](https://github.com/diaspora/diaspora/pull/8418)
* Remove `i18n-inflector-rails` for translations [#8420](https://github.com/diaspora/diaspora/pull/8420)
* Update carrierwave and add ruby 3.0 support [#8423](https://github.com/diaspora/diaspora/pull/8423)
* Add ruby 3.0 support [#8423](https://github.com/diaspora/diaspora/pull/8423)

## Bug fixes
* Fix multiple photos upload progress bar [#7655](https://github.com/diaspora/diaspora/pull/7655)
Expand Down
13 changes: 12 additions & 1 deletion config/bundler_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ def self.database
end

private_class_method def self.parse_value_from_yaml_file(file, *keys)
parse_yaml_file(file).dig(*keys)
end

private_class_method def self.parse_yaml_file(file)
path = File.join(__dir__, file)
YAML.load_file(path).dig(*keys) if File.file?(path)

return {} unless File.file?(path)

if YAML.respond_to?(:unsafe_load_file)
YAML.unsafe_load_file(path)
else
YAML.load_file(path)
end
end

private_class_method def self.parse_value_from_toml_file(file, key)
Expand Down

0 comments on commit 9cdfd3a

Please sign in to comment.