From c1f6ad561bfb584ac9fc477f0855d087ce4bcd6d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 16 Oct 2024 17:33:20 +0900 Subject: [ruby/yaml] Also use safe_load on YAML::Store https://github.com/ruby/yaml/commit/09691d005f --- lib/yaml/store.rb | 4 ++-- 1 file 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 -- cgit v1.2.3