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:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-06-21 00:33:01 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-06 02:57:09 +0300
commitab811b6ab929d3f220e060c15c49bc075d91e5f2 (patch)
treebbe8091322f85e1bdc9c5a91597f4723edf4f51b /app/models/label.rb
parente186626d25d5a24e2f2c5f0b5082b79bc8bd0ddf (diff)
Render references for labels that name contains ?, or &
Diffstat (limited to 'app/models/label.rb')
-rw-r--r--app/models/label.rb16
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(/(&gt;)|(&lt;)|(&amp;)/, Label::TABLE_FOR_ESCAPE_HTML_ENTITIES.invert)
- end
-
- TABLE_FOR_ESCAPE_HTML_ENTITIES = {
- '&' => '&amp;',
- '<' => '&lt;',
- '>' => '&gt;'
- }
end