Commit 69b10e16 authored by Toon Claes's avatar Toon Claes

Fallback to default pattern when note does not belong to project

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
parent 7ea12d80
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment