rails/rails — Issue #3927: warning: regexp match /.../n against to UTF-8 string
Author: dmarczal
Created: 2011-12-10 12:32:30+00:00
State: open

I updated the rails to 3.1.3 and a got the follow warning:

bundler/gems/rails-d06c3b3cd22c/activesupport/lib/active_support/core_ext/string/output_safety.rb:23: warning: regexp match /.../n against to UTF-8 string

To not show this warning I changed the output_safety.rb line 23

from
`` s.gsub(/[&"><]/n) { |special| HTML_ESCAPE[special] }.html_safe
to
`` s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] }.html_safe

removing the ''n'' option of the Regex.

This is a problem with output_safety? Is there another way to fix this warning?