From d03196c89e92e9b3aa553bf5f7a9bcb23c955025 Mon Sep 17 00:00:00 2001 From: Phil Smith Date: Mon, 19 Apr 2010 12:43:42 -0700 Subject: Regexp.escape(load_path) in add_routing_namespaces initializer [#4442 state:resolved] Signed-off-by: Michael Koziarski --- railties/lib/rails/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 0f33b40a13..98da7e2b4a 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -166,7 +166,7 @@ module Rails paths.app.controllers.to_a.each do |load_path| load_path = File.expand_path(load_path) Dir["#{load_path}/*/**/*_controller.rb"].collect do |path| - namespace = File.dirname(path).sub(/#{load_path}\/?/, '') + namespace = File.dirname(path).sub(/#{Regexp.escape(load_path)}\/?/, '') app.routes.controller_namespaces << namespace unless namespace.empty? end end -- cgit v1.2.3