Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
abc06c25
Commit
abc06c25
authored
Apr 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't leak existence of group or project via search.
parent
1f813024
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
CHANGELOG
CHANGELOG
+1
-0
app/controllers/search_controller.rb
app/controllers/search_controller.rb
+11
-4
No files found.
CHANGELOG
View file @
abc06c25
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
v 7.10.0 (unreleased)
- Don't leak existence of project via search autocomplete.
- Don't leak existence of project via search autocomplete.
- Don't leak existence of group or project via search.
- Fix broken file browsing with a submodule that contains a relative link (Stan Hu)
- Fix broken file browsing with a submodule that contains a relative link (Stan Hu)
- Fix bug where Wiki pages that included a '/' were no longer accessible (Stan Hu)
- Fix bug where Wiki pages that included a '/' were no longer accessible (Stan Hu)
- Fix bug where error messages from Dropzone would not be displayed on the issues page (Stan Hu)
- Fix bug where error messages from Dropzone would not be displayed on the issues page (Stan Hu)
...
...
app/controllers/search_controller.rb
View file @
abc06c25
...
@@ -3,15 +3,22 @@ class SearchController < ApplicationController
...
@@ -3,15 +3,22 @@ class SearchController < ApplicationController
def
show
def
show
return
if
params
[
:search
].
nil?
||
params
[
:search
].
blank?
return
if
params
[
:search
].
nil?
||
params
[
:search
].
blank?
@project
=
Project
.
find_by
(
id:
params
[
:project_id
])
if
params
[
:project_id
].
present?
@group
=
Group
.
find_by
(
id:
params
[
:group_id
])
if
params
[
:group_id
].
present?
if
params
[
:project_id
].
present?
@project
=
Project
.
find_by
(
id:
params
[
:project_id
])
@project
=
nil
unless
can?
(
current_user
,
:download_code
,
@project
)
end
if
params
[
:group_id
].
present?
@group
=
Group
.
find_by
(
id:
params
[
:group_id
])
@group
=
nil
unless
can?
(
current_user
,
:read_group
,
@group
)
end
@scope
=
params
[
:scope
]
@scope
=
params
[
:scope
]
@show_snippets
=
params
[
:snippets
].
eql?
'true'
@show_snippets
=
params
[
:snippets
].
eql?
'true'
@search_results
=
@search_results
=
if
@project
if
@project
return
access_denied!
unless
can?
(
current_user
,
:download_code
,
@project
)
unless
%w(blobs notes issues merge_requests wiki_blobs)
.
unless
%w(blobs notes issues merge_requests wiki_blobs)
.
include?
(
@scope
)
include?
(
@scope
)
@scope
=
'blobs'
@scope
=
'blobs'
...
...
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