[ruby/yaml] Also use safe_load on YAML::Store

https://github.com/ruby/yaml/commit/09691d005f
This commit is contained in:
Hiroshi SHIBATA 2024-10-16 17:33:20 +09:00 committed by git
parent 21bac99122
commit c1f6ad561b

View File

@ -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