aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2010-01-07 17:45:32 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2010-01-07 17:45:32 -0800
commit5ea130943eb27586272ecebb060ff1475cadbed6 (patch)
tree6a76d2402f5101f2b1ca3d1543a2105a54807d3c
parent1ddf17dff0cb21c9e13842af82cfbd0c22c38e62 (diff)
downloadrails-5ea130943eb27586272ecebb060ff1475cadbed6.tar.gz
rails-5ea130943eb27586272ecebb060ff1475cadbed6.tar.bz2
rails-5ea130943eb27586272ecebb060ff1475cadbed6.zip
Fixed that fragment caching should return a cache hit as html_safe (or it would all just get escaped) [DHH]
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/caching/fragments.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 7673b9fe56..1ea0904578 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*Edge*
+* Fixed that fragment caching should return a cache hit as html_safe (or it would all just get escaped) [DHH]
+
* Added that ActionController::Base now does helper :all instead of relying on the default ApplicationController in Rails to do it [DHH]
* Added ActionDispatch::Request#authorization to access the http authentication header regardless of its proxy hiding [DHH]
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb
index a0c5ed797e..806e6a1750 100644
--- a/actionpack/lib/action_controller/caching/fragments.rb
+++ b/actionpack/lib/action_controller/caching/fragments.rb
@@ -37,7 +37,7 @@ module ActionController #:nodoc:
def fragment_for(buffer, name = {}, options = nil, &block) #:nodoc:
if perform_caching
if fragment_exist?(name,options)
- buffer.concat(read_fragment(name, options))
+ buffer.concat(read_fragment(name, options).html_safe!)
else
pos = buffer.length
block.call