Skip to content

Commit

Permalink
Use permitted_classes: [Symbol] with YAML.safe_load (#29)
Browse files Browse the repository at this point in the history
Add `permitted_classes: [Symbol]` to the `YAML.safe_load` call so that it will not error if there are values that start with a colon character (:)
  • Loading branch information
westonganger authored Feb 6, 2025
1 parent 69d7d2c commit b4a4a7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CHANGELOG

### Unreleased - [View Diff](https://github.com/westonganger/rails_i18n_manager/compare/v1.1.2...master)
- Nothing yet
- [#29](https://github.com/westonganger/rails_i18n_manager/pull/29) - Add `permitted_classes: [Symbol]` to `YAML.safe_load` call so that it will not error if there are values that start with a colon character (:)

### v1.1.2 - February 4, 2025 - [View Diff](https://github.com/westonganger/rails_i18n_manager/compare/v1.1.1...v1.1.2)
- [#28](https://github.com/westonganger/rails_i18n_manager/pull/28) - Dont use dig method in import which could result in exception `TypeError: Undefined method dig for String`
Expand Down
2 changes: 1 addition & 1 deletion app/lib/rails_i18n_manager/forms/translation_file_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def parsed_file_contents

case file_extname
when ".yml", ".yaml"
@parsed_file_contents = YAML.safe_load(file_contents_string)
@parsed_file_contents = YAML.safe_load(file_contents_string, permitted_classes: [Symbol])
when ".json"
@parsed_file_contents = JSON.parse(file_contents_string)
end
Expand Down

0 comments on commit b4a4a7f

Please sign in to comment.