Skip to content
Snippets Groups Projects
Commit 6a7e88b8 authored by Toon Claes's avatar Toon Claes Committed by Tim Zallmann
Browse files

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 4325380e
No related branches found
No related tags found
1 merge request!11370WIP: Resolve "Rename Audit Log"
Loading
@@ -92,7 +92,7 @@ module Mentionable
Loading
@@ -92,7 +92,7 @@ module Mentionable
# Uses regex to quickly determine if mentionables might be referenced # Uses regex to quickly determine if mentionables might be referenced
# Allows heavy processing to be skipped # Allows heavy processing to be skipped
def matches_cross_reference_regex? def matches_cross_reference_regex?
reference_pattern = if project.default_issues_tracker? reference_pattern = if !project || project.default_issues_tracker?
ReferenceRegexes::DEFAULT_PATTERN ReferenceRegexes::DEFAULT_PATTERN
else else
ReferenceRegexes::EXTERNAL_PATTERN 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