diff options
author | Hiroshi SHIBATA <[email protected]> | 2024-10-16 17:33:20 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-10-16 08:49:54 +0000 |
commit | c1f6ad561bfb584ac9fc477f0855d087ce4bcd6d (patch) | |
tree | 76ef111acfde0b893be0478b1073305f20210bf7 | |
parent | 21bac99122188d3b7852dc67563ac15bbd67ba05 (diff) |
[ruby/yaml] Also use safe_load on YAML::Store
https://github.com/ruby/yaml/commit/09691d005f
-rw-r--r-- | lib/yaml/store.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/yaml/store.rb b/lib/yaml/store.rb index f24e4ad332..859621d271 100644 --- a/lib/yaml/store.rb +++ b/lib/yaml/store.rb @@ -69,8 +69,8 @@ class YAML::Store < PStore end def load(content) - table = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(content) : YAML.load(content) - if table == false + table = YAML.respond_to?(:safe_load) ? YAML.safe_load(content, permitted_classes: [Symbol]) : YAML.load(content) + if table == false || table == nil {} else table |