mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 05:53:47 +08:00
SECURITY: santize tags when creating new topic via URL
This commit is contained in:
parent
27972c1202
commit
3edd6622df
|
@ -696,7 +696,12 @@ export default Ember.Controller.extend({
|
|||
}
|
||||
|
||||
if (opts.topicTags && !this.site.mobileView && this.site.get('can_tag_topics')) {
|
||||
this.set('model.tags', opts.topicTags.split(","));
|
||||
const self = this;
|
||||
let tags = escapeExpression(opts.topicTags).split(",").slice(0, self.siteSettings.max_tags_per_topic);
|
||||
tags.forEach(function(tag, index, array) {
|
||||
array[index] = tag.substring(0, self.siteSettings.max_tag_length);
|
||||
});
|
||||
self.set('model.tags', tags);
|
||||
}
|
||||
|
||||
if (opts.topicBody) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user