Skip to content
Snippets Groups Projects
Commit 7d68071d authored by Toon Claes's avatar Toon Claes
Browse files

Use external pattern when mentionable 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 mentionable might not
belong to a project. So when it doesn't belong to a project, use the
EXTERNAL_PATTERN to search if there are mentionables.

Fixes gitlab-org/gitlab-ce#31993
parent 7ea12d80
Branches
Tags
No related merge requests found
Pipeline #
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment