X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/a12d4f62752f546f57421244e370e79965706ffb..f7aee769411a893c1059c529a220c0d25c72974f:/vendor/plugins/engines/lib/engines/routing_extensions.rb diff --git a/vendor/plugins/engines/lib/engines/routing_extensions.rb b/vendor/plugins/engines/lib/engines/routing_extensions.rb new file mode 100644 index 0000000..00f6b63 --- /dev/null +++ b/vendor/plugins/engines/lib/engines/routing_extensions.rb @@ -0,0 +1,28 @@ +module ActionController + module Routing + + class << self + # This holds the global list of valid controller paths + attr_accessor :controller_paths + end + + class ControllerComponent + class << self + protected + def safe_load_paths #:nodoc: + if defined?(RAILS_ROOT) + paths = $LOAD_PATH.select do |base| + base = File.expand_path(base) + # Check that the path matches one of the allowed paths in controller_paths + base.match(/^#{ActionController::Routing.controller_paths.map { |p| File.expand_path(p) } * '|'}/) + end + Engines.log.debug "Engines safe_load_paths: #{paths.inspect}" + paths + else + $LOAD_PATH + end + end + end + end + end +end \ No newline at end of file