diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-06-21 09:26:26 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-06-21 09:26:26 +0000 |
commit | 94da20fde1a08c8c35c1de350b31f30185a9007b (patch) | |
tree | 92d0a2753ae5be2ccb2abdd44762e28826d71303 /app | |
parent | 069c95e13ff626b5975f50846e4496ac7ff5463c (diff) | |
parent | 1753efbc143d18fe0c29e33319b8779c1d03f7c6 (diff) | |
download | gitlab-ce-94da20fde1a08c8c35c1de350b31f30185a9007b.tar.gz |
Merge branch 'dm-label-reference-period' into 'master'
Properly detect label reference if followed by period or question mark
See merge request gitlab-org/gitlab-ce!19965
Diffstat (limited to 'app')
-rw-r--r-- | app/models/label.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 1cf04976602..7bbcaa121ca 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -85,11 +85,16 @@ class Label < ActiveRecord::Base (#{Project.reference_pattern})? #{Regexp.escape(reference_prefix)} (?: - (?<label_id>\d+(?!\S\w)\b) | # Integer-based label ID, or - (?<label_name> - [A-Za-z0-9_\-\?\.&]+ | # String-based single-word label title, or - ".+?" # String-based multi-word label surrounded in quotes - ) + (?<label_id>\d+(?!\S\w)\b) + | # Integer-based label ID, or + (?<label_name> + # String-based single-word label title, or + [A-Za-z0-9_\-\?\.&]+ + (?<!\.|\?) + | + # String-based multi-word label surrounded in quotes + ".+?" + ) ) }x end |