summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-05-09 10:59:18 +0200
committerToon Claes <toon@gitlab.com>2017-05-09 11:36:45 +0200
commit69b10e1695bd68b570bc9993777b0d1446e85a57 (patch)
treea40f0a2d52ca80cd00b7e6d4db09e83d58e1a972 /app
parent7ea12d8067357f8e846e26b05a1dc4ab3d5a5a93 (diff)
downloadgitlab-ce-69b10e1695bd68b570bc9993777b0d1446e85a57.tar.gz
Fallback to default pattern when note does not belong to projecttc-fix-snippets-notes-spec
In commit 020295ff a regex was added to quickly determine if mentionables might be referenced. But this didn't take into account the note might not belong to a project. So when it doesn't belong to a project, assume the default issue tracker is used, and use DEFAULT_PATTERN to check if there are mentionables. Fixes gitlab-org/gitlab-ce#31993
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/mentionable.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb
index 5ac56ac6fa0..6eddeab515e 100644
--- a/app/models/concerns/mentionable.rb
+++ b/app/models/concerns/mentionable.rb
@@ -92,7 +92,7 @@ module Mentionable
# Uses regex to quickly determine if mentionables might be referenced
# Allows heavy processing to be skipped
def matches_cross_reference_regex?
- reference_pattern = if project.default_issues_tracker?
+ reference_pattern = if !project || project.default_issues_tracker?
ReferenceRegexes::DEFAULT_PATTERN
else
ReferenceRegexes::EXTERNAL_PATTERN