SECURITY: santize tags when creating new topic via URL

This commit is contained in:
Arpit Jalan 2018-04-16 01:07:47 +05:30
parent 27972c1202
commit 3edd6622df

View File

@ -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) {