diff options
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/models/label.rb | 5 | ||||
-rw-r--r-- | app/models/milestone.rb | 5 |
3 files changed, 5 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG index 925740e5d98..fe56dd97ee6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ v 8.8.0 (unreleased) - Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project - Updated search UI - Display informative message when new milestone is created + - Sanitize milestones and labels titles - Allow "NEWS" and "CHANGES" as alternative names for CHANGELOG. !3768 (Connor Shea) - Added button to toggle whitespaces changes on diff view - Backport GitLab Enterprise support from EE diff --git a/app/models/label.rb b/app/models/label.rb index 0b34911a4e9..c551ceef64e 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -117,9 +117,8 @@ class Label < ActiveRecord::Base LabelsHelper::text_color_for_bg(self.color) end - def title= value - value = Sanitize.clean(value.to_s) if value - write_attribute(:title, Sanitize.clean(value)) + def title=(value) + write_attribute(:title, Sanitize.clean(value.to_s)) if value.present? end private diff --git a/app/models/milestone.rb b/app/models/milestone.rb index ed81791c69c..15a786210fa 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -129,9 +129,8 @@ class Milestone < ActiveRecord::Base nil end - def title= value - value = Sanitize.clean(value.to_s) if value - write_attribute(:title, value) + def title=(value) + write_attribute(:title, Sanitize.clean(value.to_s)) if value.present? end # Sorts the issues for the given IDs. |