summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-25 16:06:34 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-05-25 16:06:34 -0400
commitb263a33c80a04be4b126c203f0c0d1439f1d5739 (patch)
tree7c2f4431da62ef090a20af6fe7f0a8d8d22d786f /lib
parent2651c8a9aaa27e3b66a820469cd5dafd4aec39d3 (diff)
downloadgitlab-ce-b263a33c80a04be4b126c203f0c0d1439f1d5739.tar.gz
Better handle label references that aren't actually referencesrs-issue-1690
Fixes #1690
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown/label_reference_filter.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/markdown/label_reference_filter.rb b/lib/gitlab/markdown/label_reference_filter.rb
index a357f28458d..1a77becee89 100644
--- a/lib/gitlab/markdown/label_reference_filter.rb
+++ b/lib/gitlab/markdown/label_reference_filter.rb
@@ -84,11 +84,11 @@ module Gitlab
#
# Returns a Hash.
def label_params(id, name)
- if id > 0
- { id: id }
- else
+ if name
# TODO (rspeicher): Don't strip single quotes if we decide to only use double quotes for surrounding.
{ name: name.tr('\'"', '') }
+ else
+ { id: id }
end
end
end