Skip to content

Commit

Permalink
Apply redirect sanitization patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
seancribbs committed Oct 19, 2008
1 parent 9c29182 commit f15243a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/rails/actionpack/lib/action_controller/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def charset

def redirect(to_url, response_status)
self.headers["Status"] = response_status
self.headers["Location"] = to_url
self.headers["Location"] = to_url.gsub(/[\r\n]/, '')

self.body = "<html><body>You are being <a href=\"#{to_url}\">redirected</a>.</body></html>"
self.body = "<html><body>You are being <a href=\"#{CGI.escapeHTML(to_url)}\">redirected</a>.</body></html>"
end

def prepare!
Expand Down

0 comments on commit f15243a

Please sign in to comment.