Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-07-16 13:49:01 +0300
committerFilipa Lacerda <filipa@gitlab.com>2018-07-17 12:21:12 +0300
commita0930b83ecfa0513990fcae8450726add1d9206d (patch)
tree8b41e3ef78c4b1d77b855050db7422c188e9d6f6 /app/controllers/projects/labels_controller.rb
parentfc9f90045d930641690f75e9bae25683dc67a24e (diff)
Escapes milestone and label names when promoting them
Diffstat (limited to 'app/controllers/projects/labels_controller.rb')
-rw-r--r--app/controllers/projects/labels_controller.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb
index 21d3c918581..ce03b2d8d1d 100644
--- a/app/controllers/projects/labels_controller.rb
+++ b/app/controllers/projects/labels_controller.rb
@@ -112,7 +112,7 @@ class Projects::LabelsController < Projects::ApplicationController
begin
return render_404 unless promote_service.execute(@label)
- flash[:notice] = "#{@label.title} promoted to <a href=\"#{group_labels_path(@project.group)}\">group label</a>.".html_safe
+ flash[:notice] = flash_notice_for(@label, @project.group)
respond_to do |format|
format.html do
redirect_to(project_labels_path(@project), status: :see_other)
@@ -135,6 +135,15 @@ class Projects::LabelsController < Projects::ApplicationController
end
end
+ def flash_notice_for(label, group)
+ notice = ''.html_safe
+ notice << label.title
+ notice << ' promoted to '
+ notice << view_context.link_to('<u>group label</u>'.html_safe, group_labels_path(group))
+ notice << '.'
+ notice
+ end
+
protected
def label_params