summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-06 19:18:04 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-06 19:18:04 +0000
commitbd200951d7e928b84bd5b4ef1210a56d688a03c9 (patch)
tree498c9c8307267ae7b58ed7798120de9f6eaa9524 /lib
parent19e2b7faf7439992f9d91f4b053d25d956f3e83a (diff)
downloadgitlab-ce-bd200951d7e928b84bd5b4ef1210a56d688a03c9.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-7-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/regex.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index 4ae6297f6f5..96f2b7570b3 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -27,7 +27,18 @@ module Gitlab
end
def package_name_regex
- @package_name_regex ||= %r{\A\@?(([\w\-\.\+]*)\/)*([\w\-\.]+)@?(([\w\-\.\+]*)\/)*([\w\-\.]*)\z}.freeze
+ @package_name_regex ||=
+ %r{
+ \A\@?
+ (?> # atomic group to prevent backtracking
+ (([\w\-\.\+]*)\/)*([\w\-\.]+)
+ )
+ @?
+ (?> # atomic group to prevent backtracking
+ (([\w\-\.\+]*)\/)*([\w\-\.]*)
+ )
+ \z
+ }x.freeze
end
def maven_file_name_regex