Skip to content
Snippets Groups Projects
Commit e64e45db authored by winniehell's avatar winniehell
Browse files

Escape search term before passing it to Regexp.new (!6241)

parent 0e3f7927
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,6 +10,7 @@ v 8.12.0 (unreleased)
- Change logo animation to CSS (ClemMakesApps)
- Instructions for enabling Git packfile bitmaps !6104
- 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
- Reduce contributions calendar data payload (ClemMakesApps)
- Add `web_url` field to issue, merge request, and snippet API objects (Ben Boeckel)
Loading
Loading
Loading
Loading
@@ -7,8 +7,10 @@ module SearchHelper
projects_autocomplete(term)
].flatten
 
search_pattern = Regexp.new(Regexp.escape(term), "i")
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,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment