diff --git a/core/client/mixins/editor-base-controller.js b/core/client/mixins/editor-base-controller.js index c6f90d2c7d..7a87b08107 100644 --- a/core/client/mixins/editor-base-controller.js +++ b/core/client/mixins/editor-base-controller.js @@ -197,7 +197,7 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, { if (status === 'published') { message += ' View ' + this.get('postOrPage') + ''; } - this.notifications.showSuccess(message, {delayed: delay}); + this.notifications.showSuccess(message.htmlSafe(), {delayed: delay}); }, showErrorNotification: function (prevStatus, status, errors, delay) { @@ -206,7 +206,7 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, { message += '
' + error; - this.notifications.showError(message, {delayed: delay}); + this.notifications.showError(message.htmlSafe(), {delayed: delay}); }, shouldFocusTitle: Ember.computed.alias('model.isNew'), diff --git a/core/client/mixins/validation-engine.js b/core/client/mixins/validation-engine.js index bc58b71c3d..ec01053687 100644 --- a/core/client/mixins/validation-engine.js +++ b/core/client/mixins/validation-engine.js @@ -29,12 +29,15 @@ function formatErrors(errors, opts) { // get the validator's error messages from the array. // normalize array members to map to strings. message = errors.map(function (error) { + var errorMessage; if (typeof error === 'string') { - return error; + errorMessage = error; + } else { + errorMessage = error.message; } - return error.message; - }).join('
'); + return Ember.Handlebars.Utils.escapeExpression(errorMessage); + }).join('
').htmlSafe(); } else if (errors instanceof Error) { message += errors.message || '.'; } else if (typeof errors === 'object') { diff --git a/core/client/templates/components/gh-notification.hbs b/core/client/templates/components/gh-notification.hbs index e239c20a04..80e7869bc7 100644 --- a/core/client/templates/components/gh-notification.hbs +++ b/core/client/templates/components/gh-notification.hbs @@ -1,6 +1,6 @@
- {{{message.message}}} + {{message.message}}
\ No newline at end of file