From 7678d123a7e46edcf418a6959b615e2387b7fad6 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Tue, 15 Aug 2006 02:04:11 +0000 Subject: Relax Routing's anchor pattern warning; it was preventing use of [^/] inside restrictions. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4763 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 8c85c712a0..7b9bbc3b5a 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -681,7 +681,7 @@ module ActionController segment = segment_named[key] if segment raise TypeError, "#{key}: requirements on a path segment must be regular expressions" unless requirement.is_a?(Regexp) - if requirement.source =~ %r{\\A|\\Z|\\z|\^|\$} + if requirement.source =~ %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z} raise ArgumentError, "Regexp anchor characters are not allowed in routing requirements: #{requirement.inspect}" end segment.regexp = requirement -- cgit v1.2.3