diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-04 18:37:53 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-04 18:37:53 -0700 |
commit | ddd552504bd682d64aa63bd06aa3f74818d48493 (patch) | |
tree | 9cadf79f29ef018600d044cc8606ec3839f50fa1 /actionpack/lib/action_controller/routing | |
parent | 61842d97c5269af8a36a33115f50543a155f1608 (diff) | |
download | rails-ddd552504bd682d64aa63bd06aa3f74818d48493.tar.gz rails-ddd552504bd682d64aa63bd06aa3f74818d48493.tar.bz2 rails-ddd552504bd682d64aa63bd06aa3f74818d48493.zip |
Expose Routing::Segment::SAFE_PCHAR list of path characters that don't need escaping
Diffstat (limited to 'actionpack/lib/action_controller/routing')
-rw-r--r-- | actionpack/lib/action_controller/routing/segments.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing/segments.rb b/actionpack/lib/action_controller/routing/segments.rb index 75784c3b78..9d4b740a44 100644 --- a/actionpack/lib/action_controller/routing/segments.rb +++ b/actionpack/lib/action_controller/routing/segments.rb @@ -2,7 +2,8 @@ module ActionController module Routing class Segment #:nodoc: RESERVED_PCHAR = ':@&=+$,;' - UNSAFE_PCHAR = Regexp.new("[^#{URI::REGEXP::PATTERN::UNRESERVED}#{RESERVED_PCHAR}]", false, 'N').freeze + SAFE_PCHAR = "#{URI::REGEXP::PATTERN::UNRESERVED}#{RESERVED_PCHAR}" + UNSAFE_PCHAR = Regexp.new("[^#{SAFE_PCHAR}]", false, 'N').freeze # TODO: Convert :is_optional accessor to read only attr_accessor :is_optional |