aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/capture_helper.rb
diff options
context:
space:
mode:
authorJeff Kreeftmeijer <jeff@kreeftmeijer.nl>2010-10-11 20:39:12 +0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-02 19:38:28 -0200
commitbb9c58eb4aa637fa75c69c705a9918d6322ff834 (patch)
tree1f6f113bdc943b1e96eb283f385383517d127aba /actionpack/lib/action_view/helpers/capture_helper.rb
parentd446392f76c063d9f04396a1d3ca9e314a521671 (diff)
downloadrails-bb9c58eb4aa637fa75c69c705a9918d6322ff834.tar.gz
rails-bb9c58eb4aa637fa75c69c705a9918d6322ff834.tar.bz2
rails-bb9c58eb4aa637fa75c69c705a9918d6322ff834.zip
Make sure capture's output gets html_escaped [#5545 state:resolved]
Also remove a duplicate test_link_to_unless assertion and add .html_safe to the remaining one. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack/lib/action_view/helpers/capture_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/capture_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb
index 0401e6a09b..2c805c8ecf 100644
--- a/actionpack/lib/action_view/helpers/capture_helper.rb
+++ b/actionpack/lib/action_view/helpers/capture_helper.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/object/blank'
+require 'active_support/core_ext/string/output_safety'
module ActionView
# = Action View Capture Helper
@@ -38,7 +39,7 @@ module ActionView
value = nil
buffer = with_output_buffer { value = yield(*args) }
if string = buffer.presence || value and string.is_a?(String)
- string
+ html_escape string
end
end