diff --git a/config/initializers/0_fix_psych.rb b/config/initializers/0_fix_psych.rb new file mode 100644 index 0000000000..f3b1a81c9a --- /dev/null +++ b/config/initializers/0_fix_psych.rb @@ -0,0 +1,9 @@ +# Ruby 3.1 includes a breaking update to Psych 4. +# Undo the breakage, as Mastodon doesn't load untrusted YAML files. +# https://stackoverflow.com/a/71192990 + +module YAML + class << self + alias_method :load, :unsafe_load if YAML.respond_to? :unsafe_load + end +end