Changeset 4750 for branches/stable/actionpack
- Timestamp:
- 08/10/06 17:13:55 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/stable/actionpack/lib/action_controller/routing.rb
r4749 r4750 263 263 end 264 264 265 attr_accessor :controller_paths266 267 265 protected 266 def safe_load_paths #:nodoc: 267 if defined?(RAILS_ROOT) 268 $LOAD_PATH.select do |base| 269 base = File.expand_path(base) 270 extended_root = File.expand_path(RAILS_ROOT) 271 # Exclude all paths that are not nested within app, lib, or components. 272 base.match(/\A#{Regexp.escape(extended_root)}\/*(app|lib|components)\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin} 273 end 274 else 275 $LOAD_PATH 276 end 277 end 268 278 269 279 def attempt_load(mod, const_name, path) 270 280 has_dir = false 271 controller_paths.each do |load_path|281 safe_load_paths.each do |load_path| 272 282 full_path = File.join(load_path, path) 273 283 file_path = full_path + '.rb'