summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorHeinrich Lee Yu <hleeyu@gmail.com>2019-01-09 16:55:29 +0800
committerYorick Peterse <yorickpeterse@gmail.com>2019-01-31 16:51:16 +0100
commit219d24fe5298f6ca5a16d4392360fe1f691aee97 (patch)
tree54038050e7e813a006f1a1e546e41aadbaa9e2d5 /app/models/project.rb
parent68d13322290a52360cd485d24bcfff995d98cf97 (diff)
downloadgitlab-ce-219d24fe5298f6ca5a16d4392360fe1f691aee97.tar.gz
Fix slow project reference pattern regex
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index da77479fe1f..4057b564738 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -530,6 +530,7 @@ class Project < ActiveRecord::Base
def reference_pattern
%r{
+ (?<!#{Gitlab::PathRegex::PATH_START_CHAR})
((?<namespace>#{Gitlab::PathRegex::FULL_NAMESPACE_FORMAT_REGEX})\/)?
(?<project>#{Gitlab::PathRegex::PROJECT_PATH_FORMAT_REGEX})
}x