aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2009-10-15 17:16:51 +1300
committerMichael Koziarski <michael@koziarski.com>2009-10-15 17:22:50 +1300
commitcc1ad46eadfad2c617d897927eb4bc0c36e1d033 (patch)
tree202e75968954e28106da43d9de0e77ffd4a8feed
parent4484f0bccf1b02ff1d05d7310afe2e572befce46 (diff)
downloadrails-cc1ad46eadfad2c617d897927eb4bc0c36e1d033.tar.gz
rails-cc1ad46eadfad2c617d897927eb4bc0c36e1d033.tar.bz2
rails-cc1ad46eadfad2c617d897927eb4bc0c36e1d033.zip
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.
-rw-r--r--actionpack/lib/action_view/base.rb5
1 files changed, 5 insertions, 0 deletions
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