Skip to content

Commit

Permalink
[FIX] Wrong render of snippet’s name
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Aug 1, 2017
1 parent 00fd6a8 commit 37ea7ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/rocketchat-message-snippet/client/messageType.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Meteor.startup(function() {
system: true,
message: 'Snippeted_a_message',
data(message) {
const snippetLink = `<a href="/snippet/${ message.snippetId }/${ message.snippetName }">${ message.snippetName }</a>`;
const snippetLink = `<a href="/snippet/${ message.snippetId }/${ encodeURIComponent(message.snippetName) }">${ _.escapeHTML(message.snippetName) }</a>`;
return { snippetLink };
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Template.snippetMessage.helpers({
}
},
body() {
return `<a href="/snippet/${ this._id }/${ this.snippetName }">${ this.snippetName }</a>`;
return `<a href="/snippet/${ this._id }/${ encodeURIComponent(this.snippetName) }">${ _.escapeHTML(this.snippetName) }</a>`;
}
});

0 comments on commit 37ea7ac

Please sign in to comment.