From b263a33c80a04be4b126c203f0c0d1439f1d5739 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 25 May 2015 16:06:34 -0400 Subject: Better handle label references that aren't actually references Fixes #1690 --- lib/gitlab/markdown/label_reference_filter.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.1