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
e64e45db
Commit
e64e45db
authored
Sep 07, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape search term before passing it to Regexp.new (!6241)
parent
0e3f7927
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
CHANGELOG
CHANGELOG
+1
-0
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+3
-1
No files found.
CHANGELOG
View file @
e64e45db
...
@@ -10,6 +10,7 @@ v 8.12.0 (unreleased)
...
@@ -10,6 +10,7 @@ v 8.12.0 (unreleased)
- Change logo animation to CSS (ClemMakesApps)
- Change logo animation to CSS (ClemMakesApps)
- Instructions for enabling Git packfile bitmaps !6104
- Instructions for enabling Git packfile bitmaps !6104
- Fix pagination on user snippets page
- Fix pagination on user snippets page
- Escape search term before passing it to Regexp.new !6241 (winniehell)
- Change merge_error column from string to text type
- Change merge_error column from string to text type
- Reduce contributions calendar data payload (ClemMakesApps)
- Reduce contributions calendar data payload (ClemMakesApps)
- Add `web_url` field to issue, merge request, and snippet API objects (Ben Boeckel)
- Add `web_url` field to issue, merge request, and snippet API objects (Ben Boeckel)
...
...
app/helpers/search_helper.rb
View file @
e64e45db
...
@@ -7,8 +7,10 @@ module SearchHelper
...
@@ -7,8 +7,10 @@ module SearchHelper
projects_autocomplete
(
term
)
projects_autocomplete
(
term
)
].
flatten
].
flatten
search_pattern
=
Regexp
.
new
(
Regexp
.
escape
(
term
),
"i"
)
generic_results
=
project_autocomplete
+
default_autocomplete
+
help_autocomplete
generic_results
=
project_autocomplete
+
default_autocomplete
+
help_autocomplete
generic_results
.
select!
{
|
result
|
result
[
:label
]
=~
Regexp
.
new
(
term
,
"i"
)
}
generic_results
.
select!
{
|
result
|
result
[
:label
]
=~
search_pattern
}
[
[
resources_results
,
resources_results
,
...
...
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