From cc1ad46eadfad2c617d897927eb4bc0c36e1d033 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Thu, 15 Oct 2009 17:16:51 +1300 Subject: Add a read-only method which plugin authors can use to determine if xss escaping. This doesn't provide a way to turn off the escaping, but alternative template engine authors can figure out what their default should be by calling this. Avoids a messy version + plugin check. --- actionpack/lib/action_view/base.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 5f28ba6ccb..b4c91a772f 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -203,6 +203,11 @@ module ActionView #:nodoc: @@cache_template_loading = nil cattr_accessor :cache_template_loading + # :nodoc: + def self.xss_safe? + true + end + def self.cache_template_loading? ActionController::Base.allow_concurrency || (cache_template_loading.nil? ? !ActiveSupport::Dependencies.load? : cache_template_loading) end -- cgit v1.2.3