Merge pull request #78 from sinatra/template-renderer-safety
Don't mutate the template cache
This commit is contained in:
commit
42ac1f502d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue