Merge pull request #78 from sinatra/template-renderer-safety

Don't mutate the template cache
This commit is contained in:
Katrina Owen 2012-12-08 14:54:53 -08:00
commit 42ac1f502d
1 changed files with 5 additions and 2 deletions

View File

@ -138,8 +138,11 @@ module Sinatra
if args.any?
locals = { :object => object }
locals.merge! object.to_hash if object.respond_to? :to_hash
args << { :locals => locals }
halt send(*args)
renderer = args.first
options = args[1..-1] + [{:locals => locals}]
halt send(renderer, *options)
end
end
if object