Skip to content

Commit

Permalink
Merge pull request #7630 from RocketChat/hotfix/wrong-snippet-name
Browse files Browse the repository at this point in the history
[FIX] Wrong render of snippet’s name
  • Loading branch information
rodrigok authored Aug 2, 2017
2 parents adda556 + 37ea7ac commit de2cbc3
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 de2cbc3

Please sign in to comment.