mirror of
https://github.com/discourse/discourse.git
synced 2025-03-29 13:46:40 +08:00

Ruby 2.7 or earlier `+contents` returns self.dup when `frozen_string_literal: true`. However, Ruby 3.0 returns self because this string is interpolated one, which is not frozen anymore. This commit uses self.dup to return duplicated string regardless Ruby versions. https://bugs.ruby-lang.org/issues/17104