diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-06-29 17:47:37 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-05 20:57:09 -0300 |
commit | 5d11cf2e98156c7fff403c3d8375da6f9b7edbf3 (patch) | |
tree | ead7820692d6d477359168b26ff968ce64e29a3e /app/models/label.rb | |
parent | d6b60e83edb755347c56e38770fcdffab9edbfa0 (diff) | |
download | gitlab-ce-5d11cf2e98156c7fff403c3d8375da6f9b7edbf3.tar.gz |
Use CGI.unescapeHTML rather than doing the gsub with a map
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index b0e2cb448b8..dc5586f5756 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -10,12 +10,6 @@ class Label < ActiveRecord::Base DEFAULT_COLOR = '#428BCA' - TABLE_FOR_ESCAPE_HTML_ENTITIES = { - '&' => '&', - '<' => '<', - '>' => '>' - } - default_value_for :color, DEFAULT_COLOR belongs_to :project @@ -140,10 +134,6 @@ class Label < ActiveRecord::Base end def sanitize_title(value) - unescape_html_entities(Sanitize.clean(value.to_s)) - end - - def unescape_html_entities(value) - value.to_s.gsub(/(>)|(<)|(&)/, TABLE_FOR_ESCAPE_HTML_ENTITIES.invert) + CGI.unescapeHTML(Sanitize.clean(value.to_s)) end end |