diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-06-21 00:33:01 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-06 02:57:09 +0300 |
commit | ab811b6ab929d3f220e060c15c49bc075d91e5f2 (patch) | |
tree | bbe8091322f85e1bdc9c5a91597f4723edf4f51b /app/models/label.rb | |
parent | e186626d25d5a24e2f2c5f0b5082b79bc8bd0ddf (diff) |
Render references for labels that name contains ?, or &
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 115f38c6dfe..086007d1864 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -58,8 +58,8 @@ class Label < ActiveRecord::Base (?: (?<label_id>\d+) | # Integer-based label ID, or (?<label_name> - [A-Za-z0-9_-]+ | # String-based single-word label title, or - "[^&\?,]+" # String-based multi-word label surrounded in quotes + [A-Za-z0-9_\-\?&]+ | # String-based single-word label title, or + "[^,]+" # String-based multi-word label surrounded in quotes ) ) }x @@ -134,16 +134,6 @@ class Label < ActiveRecord::Base end def sanitize_title(value) - unnescape_html_entities(Sanitize.clean(value.to_s)) + LabelsHelper.unescape_html_entities(Sanitize.clean(value.to_s)) end - - def unnescape_html_entities(value) - value.to_s.gsub(/(>)|(<)|(&)/, Label::TABLE_FOR_ESCAPE_HTML_ENTITIES.invert) - end - - TABLE_FOR_ESCAPE_HTML_ENTITIES = { - '&' => '&', - '<' => '<', - '>' => '>' - } end |