diff options
author | Eric Wong <e@80x24.org> | 2022-01-20 18:34:19 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-01-21 19:54:43 +0000 |
commit | 88a8d4793473259b392241f1e2d20d39bd96b214 (patch) | |
tree | 28e3fb5d17017038045de143bd2e6a7d95655d0d /test/test_encoding.rb | |
parent | 748c3633ce794685af343de0bcd24eca7440281b (diff) | |
download | dtas-88a8d4793473259b392241f1e2d20d39bd96b214.tar.gz |
Psych 4.x defaults to "nanny mode" to handle untrusted data. This causes breakage with since YAML references (aliases) emitted by dtas-player can't be handled by Psych clients under Ruby 3.1. Since dtas is single user and is a shell designed to run arbitrary code, favor the new YAML.unsafe_load API which behaves like the old YAML.load in Ruby <= 3.0.
Diffstat (limited to 'test/test_encoding.rb')
-rw-r--r-- | test/test_encoding.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_encoding.rb b/test/test_encoding.rb index 9ef6a25..666d185 100644 --- a/test/test_encoding.rb +++ b/test/test_encoding.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2020 all contributors <dtas-all@nongnu.org> +# Copyright (C) all contributors <dtas-all@nongnu.org> # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt> # frozen_string_literal: true require './test/helper' @@ -13,7 +13,7 @@ comments: ARTIST: !binary |- RW5yaXF1ZSBSb2Ryw61ndWV6 EOD - hash = YAML.load(data) + hash = DTAS.yaml_load(data) artist = DTAS.try_enc(hash['comments']['ARTIST'], Encoding::UTF_8) assert_equal 'Enrique RodrÃguez', artist end |