From 4cb20843ebbbc4d8e2599d57d9cd60a9ba66fe01 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 21 Nov 2020 11:03:04 +0900 Subject: [PATCH] Mark scrub as an unsafe method on SafeBuffer --- .../lib/active_support/core_ext/string/output_safety.rb | 2 +- activesupport/test/safe_buffer_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 635f9cf457..6c194bfbb4 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -134,7 +134,7 @@ module ActiveSupport #:nodoc: class SafeBuffer < String UNSAFE_STRING_METHODS = %w( capitalize chomp chop delete delete_prefix delete_suffix - downcase lstrip next reverse rstrip slice squeeze strip + downcase lstrip next reverse rstrip scrub slice squeeze strip succ swapcase tr tr_s unicode_normalize upcase ) diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb index 803904b54b..e7352d4343 100644 --- a/activesupport/test/safe_buffer_test.rb +++ b/activesupport/test/safe_buffer_test.rb @@ -88,6 +88,7 @@ class SafeBufferTest < ActiveSupport::TestCase next: nil, reverse: nil, rstrip: nil, + scrub: nil, slice: "foo", squeeze: nil, strip: nil,