summaryrefslogtreecommitdiff
path: root/app/models/label.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-06-29 17:47:37 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-05 20:57:09 -0300
commit5d11cf2e98156c7fff403c3d8375da6f9b7edbf3 (patch)
treeead7820692d6d477359168b26ff968ce64e29a3e /app/models/label.rb
parentd6b60e83edb755347c56e38770fcdffab9edbfa0 (diff)
downloadgitlab-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.rb12
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 = {
- '&' => '&amp;',
- '<' => '&lt;',
- '>' => '&gt;'
- }
-
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(/(&gt;)|(&lt;)|(&amp;)/, TABLE_FOR_ESCAPE_HTML_ENTITIES.invert)
+ CGI.unescapeHTML(Sanitize.clean(value.to_s))
end
end