back_url entry becomes urlencoded
I just updated my test install to the latest SVN version and noticed that back_url containd %2fredmine%2f instead of /redmine/. I had also done some apache configuration changes so I'm not sure if this was due to the Redmine update or my changes. Anyhow, I did verify that if back_url gets urlencoded, the call to redirect_to is going to result in getting directed to an invalid URL.
I'm not sure of the 'right' way to handle this -- I believe you need to either make sure it does not become urlencoded in the first place, or at least make sure the redirect_to call urldecodes it first.
On my test install I did a quick hack to add in a CGI::unescape() call inside the redirect_to call and it does work, but I'm not sure if that is the "best" way or not. I'll leave that decision to the people in charge. :)
#1 Updated by Jean-Philippe Lang about 13 years ago
- Status changed from New to Resolved
- Target version set to 0.8
- Resolution set to Fixed
I could not reproduce this problem. What's your Rails version and browser?
Anyway, I've added a call to
ApplicationController#redirect_back_or_default that should solve this problem (r1893).
#2 Updated by Robert Chady about 13 years ago
I'm using Rails 2.1.0 and Firefox 3.0.1. This behavior did not show up until I had reconfigured apache to use a <Location> block for redmine rewriting it to a redmine_cluster w/mongrel_cluster. Everything worked as expected, other than the back_url suddenly getting urlencoded like I mentioned.
Having run this with my changes, which are basically the same that you did, for a couple weeks now, everything looks good now.