Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading of yaml content for ruby version newer than 3.1.0 #10

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

krauselukas
Copy link
Contributor

With ruby 3.1.0, psych version 4.0.0 got introduced. Starting psych version 4.0.0 the load method defaults to safe_load.

See ruby/psych#487
See https://stdgems.org/psych/

This got introduced to prevent users from accidentally load yaml content from untrusted user input. But
now breaks certain patterns, when using the gem.

See https://bugs.ruby-lang.org/issues/17866

To still allow users to load trusted documents,
the unsafe_load method got introduced.

See ruby/psych#488

I added a ruby version check for backwards
compatibility.

With ruby 3.1.0, psych version 4.0.0 got introduced.
Starting psych version 4.0.0 the `load` method defaults
to `safe_load`.

See ruby/psych#487
See https://stdgems.org/psych/

This got introduced to prevent users from accidentally
load yaml content from untrusted user input. But
now breaks certain patterns, when using the gem.

See https://bugs.ruby-lang.org/issues/17866

To still allow users to load trusted documents,
the `unsafe_load` method got introduced.

See ruby/psych#488

I added a ruby version check for backwards
compatibility.
Copy link
Owner

@tzmfreedom tzmfreedom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krauselukas thank you!!

@tzmfreedom tzmfreedom merged commit 962dbe8 into tzmfreedom:master Apr 27, 2023
@krauselukas krauselukas deleted the fix_yaml_load branch April 27, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants