diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-29 12:50:09 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-29 12:50:09 -0300 |
commit | 724707edfdedc63672284be2887484e8b65da02e (patch) | |
tree | 9dc977bf61224ffcaf93a714971c877b72482c9d /activesupport/test/safe_buffer_test.rb | |
parent | b67b57d47368b4b834cfe8c58d9e26f5c819c154 (diff) | |
parent | 983674667a21ee2e4e6a43282507858634dce907 (diff) | |
download | rails-724707edfdedc63672284be2887484e8b65da02e.tar.gz rails-724707edfdedc63672284be2887484e8b65da02e.tar.bz2 rails-724707edfdedc63672284be2887484e8b65da02e.zip |
Merge pull request #18236 from vipulnsward/dont-eval-frozen
Fix html_safe string access modifying frozen values
Diffstat (limited to 'activesupport/test/safe_buffer_test.rb')
-rw-r--r-- | activesupport/test/safe_buffer_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb index efa9d5e61f..fca4b45276 100644 --- a/activesupport/test/safe_buffer_test.rb +++ b/activesupport/test/safe_buffer_test.rb @@ -165,4 +165,13 @@ class SafeBufferTest < ActiveSupport::TestCase x = 'foo %{x} bar'.html_safe % { x: 'qux' } assert x.html_safe?, 'should be safe' end + + test 'Should not affect frozen objects when accessing characters' do + x = 'Hello'.html_safe + assert_nothing_raised do + x[/a/, 1] + end + end + + end |