BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1cefb73a
Commit
1cefb73a
authored
Mar 07, 2016
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check redirect path in the continue_params
Fixes
https://dev.gitlab.org/gitlab/gitlabhq/issues/2649
https://gitlab.com/gitlab-org/gitlab-ce/issues/13956
parent
a3b626bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
21 deletions
+17
-21
continue_to_params.rb
app/controllers/concerns/continue_to_params.rb
+13
-0
forks_controller.rb
app/controllers/projects/forks_controller.rb
+2
-11
imports_controller.rb
app/controllers/projects/imports_controller.rb
+2
-10
No files found.
app/controllers/concerns/continue_to_params.rb
0 → 100644
View file @
1cefb73a
module
ContinueToParams
extend
ActiveSupport
::
Concern
def
continue_params
continue_params
=
params
[
:continue
]
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?
(
'/'
)
continue_params
end
end
app/controllers/projects/forks_controller.rb
View file @
1cefb73a
class
Projects
::
ForksController
<
Projects
::
ApplicationController
include
ContinueToParams
# Authorize
before_action
:require_non_empty_project
before_action
:authorize_download_code!
...
...
@@ -53,15 +55,4 @@ class Projects::ForksController < Projects::ApplicationController
render
:error
end
end
private
def
continue_params
continue_params
=
params
[
:continue
]
if
continue_params
continue_params
.
permit
(
:to
,
:notice
,
:notice_now
)
else
nil
end
end
end
app/controllers/projects/imports_controller.rb
View file @
1cefb73a
class
Projects
::
ImportsController
<
Projects
::
ApplicationController
include
ContinueToParams
# Authorize
before_action
:authorize_admin_project!
before_action
:require_no_repo
,
only:
[
:new
,
:create
]
...
...
@@ -44,16 +46,6 @@ class Projects::ImportsController < Projects::ApplicationController
private
def
continue_params
continue_params
=
params
[
:continue
]
if
continue_params
continue_params
.
permit
(
:to
,
:notice
,
:notice_now
)
else
nil
end
end
def
finished_notice
if
@project
.
forked?
'The project was successfully forked.'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment