aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorEgor Homakov <homakov@gmail.com>2013-02-01 00:01:11 +0700
committerEgor Homakov <homakov@gmail.com>2013-02-01 00:01:11 +0700
commitbaa240d09c09b74e9bc69c91e4b5c9fb5bca2005 (patch)
treecbf92899e7930347a83d7ad4ed64b1e9391abf24 /actionpack/lib/action_controller/metal
parentee4a2bb23d46ee3e644293ba59b70fa7ecb3f7eb (diff)
downloadrails-baa240d09c09b74e9bc69c91e4b5c9fb5bca2005.tar.gz
rails-baa240d09c09b74e9bc69c91e4b5c9fb5bca2005.tar.bz2
rails-baa240d09c09b74e9bc69c91e4b5c9fb5bca2005.zip
Use \A in Regexps
So, if there is redirect_to params[:q] i can send ?q=javascript:asdf()%0A/localpath Or something more nasty, so please use \A
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/redirecting.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb
index 59b91a240e..e9031f3fac 100644
--- a/actionpack/lib/action_controller/metal/redirecting.rb
+++ b/actionpack/lib/action_controller/metal/redirecting.rb
@@ -88,7 +88,7 @@ module ActionController
# letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
# characters; and is terminated by a colon (":").
# The protocol relative scheme starts with a double slash "//"
- when %r{^(\w[\w+.-]*:|//).*}
+ when %r{\A(\w[\w+.-]*:|//).*}
options
when String
request.protocol + request.host_with_port + options