SECURITY: Escape strings in logs

This commit is contained in:
Sam Saffron 2014-09-16 07:53:17 +10:00
parent 8ba8846589
commit bb64c2236b

View file

@ -22,14 +22,14 @@ Discourse.StaffActionLog = Discourse.Model.extend({
formatted += this.format('admin.logs.staff_actions.previous_value', 'previous_value');
}
if (!this.get('useModalForDetails')) {
if (this.get('details')) formatted += this.get('details') + '<br/>';
if (this.get('details')) formatted += Handlebars.Utils.escapeExpression(this.get('details')) + '<br/>';
}
return formatted;
}.property('ip_address', 'email'),
format: function(label, propertyName) {
if (this.get(propertyName)) {
return ('<b>' + I18n.t(label) + ':</b> ' + this.get(propertyName) + '<br/>');
return ('<b>' + I18n.t(label) + ':</b> ' + Handlebars.Utils.escapeExpression(this.get(propertyName)) + '<br/>');
} else {
return '';
}