diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index df04646f3c..ded4db9087 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -162,7 +162,7 @@ class RDoc::RDoc RDoc.load_yaml begin - options = YAML.load_file '.rdoc_options' + options = YAML.unsafe_load_file '.rdoc_options' rescue Psych::SyntaxError end diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb index 140c4afc9b..a79d5dfa31 100644 --- a/test/rdoc/test_rdoc_options.rb +++ b/test/rdoc/test_rdoc_options.rb @@ -145,7 +145,7 @@ class TestRDocOptions < RDoc::TestCase @options.encoding = Encoding::IBM437 - options = YAML.load YAML.dump @options + options = YAML.unsafe_load YAML.dump @options assert_equal Encoding::IBM437, options.encoding end @@ -161,7 +161,7 @@ rdoc_include: - /etc YAML - options = YAML.load yaml + options = YAML.unsafe_load yaml assert_empty options.rdoc_include assert_empty options.static_path @@ -749,7 +749,7 @@ rdoc_include: assert File.exist? '.rdoc_options' - assert_equal @options, YAML.load(File.read('.rdoc_options')) + assert_equal @options, YAML.unsafe_load(File.read('.rdoc_options')) end end