aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/router/utils.rb
diff options
context:
space:
mode:
authoredogawaconan <me@myconan.net>2014-04-07 15:34:21 +0900
committerAndrew White <andyw@pixeltrix.co.uk>2014-04-20 10:11:37 +0100
commite2ef83f8387679ce540d745659a79dd13164f9b5 (patch)
tree1b4bcc824cc62dd2fbd96032dd2a0601dbbc048e /actionpack/lib/action_dispatch/journey/router/utils.rb
parentc524556e58bcacade1d67c057c0fa30c0bd13327 (diff)
downloadrails-e2ef83f8387679ce540d745659a79dd13164f9b5.tar.gz
rails-e2ef83f8387679ce540d745659a79dd13164f9b5.tar.bz2
rails-e2ef83f8387679ce540d745659a79dd13164f9b5.zip
Always escape string passed to url helper.
Makes it clear that anything passed with the helper must not be percent encoded. Fixes previous behavior which tricks people into believing passing non-percent-encoded will generate a proper percent-encoded path while in reality it doesn't ('%' isn't escaped). The intention is nice but the heuristic is broken.
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/router/utils.rb')
-rw-r--r--actionpack/lib/action_dispatch/journey/router/utils.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/router/utils.rb b/actionpack/lib/action_dispatch/journey/router/utils.rb
index d1a004af50..371de21f68 100644
--- a/actionpack/lib/action_dispatch/journey/router/utils.rb
+++ b/actionpack/lib/action_dispatch/journey/router/utils.rb
@@ -29,7 +29,7 @@ module ActionDispatch
# Symbol captures can generate multiple path segments, so include /.
reserved_segment = '/'
reserved_fragment = '/?'
- reserved_pchar = ':@&=+$,;%'
+ reserved_pchar = ':@&=+$,;'
safe_pchar = "#{URI::REGEXP::PATTERN::UNRESERVED}#{reserved_pchar}"
safe_segment = "#{safe_pchar}#{reserved_segment}"