summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-21 12:45:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-09-21 12:45:22 +0000
commit8a356baf3e320607ec6f85dd33f7fa8887dc1ebd (patch)
treeebaa6904582971e77d9577e11a1e0b3a890e7453 /app
parente1c4659752d25e5e3bd507648485205e1e3df9d0 (diff)
downloadredmine-8a356baf3e320607ec6f85dd33f7fa8887dc1ebd.tar.gz
redmine-8a356baf3e320607ec6f85dd33f7fa8887dc1ebd.zip
Unescape back_url param before calling redirect_to.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1893 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application.rb3
-rw-r--r--app/controllers/timelog_controller.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index 795c50d4b..238239c44 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'uri'
+require 'cgi'
class ApplicationController < ActionController::Base
layout 'base'
@@ -123,7 +124,7 @@ class ApplicationController < ActionController::Base
end
def redirect_back_or_default(default)
- back_url = params[:back_url]
+ back_url = CGI.unescape(params[:back_url].to_s)
if !back_url.blank?
uri = URI.parse(back_url)
# do not redirect user to another host
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 897a50fe5..c333c02bb 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -194,7 +194,7 @@ class TimelogController < ApplicationController
@time_entry.attributes = params[:time_entry]
if request.post? and @time_entry.save
flash[:notice] = l(:notice_successful_update)
- redirect_to(params[:back_url].blank? ? {:action => 'details', :project_id => @time_entry.project} : params[:back_url])
+ redirect_back_or_default :action => 'details', :project_id => @time_entry.project
return
end
end