diff options
author | Carsten Zimmermann <carp@hacksocke.de> | 2013-10-29 18:17:57 +0100 |
---|---|---|
committer | Carsten Zimmermann <carp@hacksocke.de> | 2013-10-29 18:17:57 +0100 |
commit | 805a6cc56469ae50803e922e09e2b9867daff1dd (patch) | |
tree | 223c677daf429fcb5e6ec6cef0833f7a735ec9ca /actionview/lib/action_view/helpers | |
parent | df2226ea16922fd4e2ea72b8ee372a4cb5621114 (diff) | |
download | rails-805a6cc56469ae50803e922e09e2b9867daff1dd.tar.gz rails-805a6cc56469ae50803e922e09e2b9867daff1dd.tar.bz2 rails-805a6cc56469ae50803e922e09e2b9867daff1dd.zip |
Convert CDATA input to string before gsub'ing
Rails 3.2 API allowed arbitrary input for cdata_section;
this change re-introduces the old behaviour.
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r-- | actionview/lib/action_view/helpers/tag_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb index 732f35643a..11e41ec056 100644 --- a/actionview/lib/action_view/helpers/tag_helper.rb +++ b/actionview/lib/action_view/helpers/tag_helper.rb @@ -114,7 +114,7 @@ module ActionView # cdata_section("hello]]>world") # # => <![CDATA[hello]]]]><![CDATA[>world]]> def cdata_section(content) - splitted = content.gsub(']]>', ']]]]><![CDATA[>') + splitted = content.to_s.gsub(']]>', ']]]]><![CDATA[>') "<![CDATA[#{splitted}]]>".html_safe end |