diff --git a/CHANGELOG b/CHANGELOG index d4554b96190d067a4c6e9383228e00ae7830308a..1929b6306db3483042da1676ff395312454a0e48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -45,6 +45,7 @@ v 8.5.3 - Show commit message in JIRA mention comment - Makes issue page and merge request page usable on mobile browsers. - Improved UI for profile settings + - Continue parameters are checked to ensure redirection goes to the same instance v 8.5.2 - Fix sidebar overlapping content when screen width was below 1200px diff --git a/app/controllers/concerns/continue_to_params.rb b/app/controllers/concerns/continue_params.rb similarity index 69% rename from app/controllers/concerns/continue_to_params.rb rename to app/controllers/concerns/continue_params.rb index 8b6c70519686c9949c0cdbef84052aa2b1ca17d3..2ff7250922d30c15ad11048e847f1691d253f069 100644 --- a/app/controllers/concerns/continue_to_params.rb +++ b/app/controllers/concerns/continue_params.rb @@ -1,4 +1,4 @@ -module ContinueToParams +module ContinueParams extend ActiveSupport::Concern def continue_params @@ -6,7 +6,7 @@ module ContinueToParams return nil unless continue_params continue_params = continue_params.permit(:to, :notice, :notice_now) - continue_params[:to] = root_url unless continue_params[:to].start_with?('/') + return unless continue_params[:to] && continue_params[:to].start_with?('/') continue_params end diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index c4884c13b126ff7e263a492f05416d6ab4cbb387..a1b8632df98227514695387007c44275b1c299f0 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -1,5 +1,5 @@ class Projects::ForksController < Projects::ApplicationController - include ContinueToParams + include ContinueParams # Authorize before_action :require_non_empty_project diff --git a/app/controllers/projects/imports_controller.rb b/app/controllers/projects/imports_controller.rb index 3756fc9139c205534b1adc8760e152eb233a08d0..7756f0f0ed3b04f054bffd6317a5a49ff6a4592f 100644 --- a/app/controllers/projects/imports_controller.rb +++ b/app/controllers/projects/imports_controller.rb @@ -1,5 +1,5 @@ class Projects::ImportsController < Projects::ApplicationController - include ContinueToParams + include ContinueParams # Authorize before_action :authorize_admin_project!