Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHeinrich Lee Yu <hleeyu@gmail.com>2019-01-09 11:55:29 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2019-01-31 18:51:16 +0300
commit219d24fe5298f6ca5a16d4392360fe1f691aee97 (patch)
tree54038050e7e813a006f1a1e546e41aadbaa9e2d5 /app
parent68d13322290a52360cd485d24bcfff995d98cf97 (diff)
Fix slow project reference pattern regex
Diffstat (limited to 'app')
-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