SECURITY: XSS Protection on Queued Posts
This commit is contained in:
parent
83d5b82c84
commit
8fdd6c18fc
|
@ -1,6 +1,6 @@
|
|||
import registerUnbound from 'discourse/helpers/register-unbound';
|
||||
|
||||
registerUnbound('cook-text', function(text) {
|
||||
return new Handlebars.SafeString(Discourse.Markdown.cook(text));
|
||||
return new Handlebars.SafeString(Discourse.Markdown.cook(text, {sanitize: true}));
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
import loadScript from 'discourse/lib/load-script';
|
||||
import DiscourseRoute from 'discourse/routes/discourse';
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
|
||||
// this route requires the sanitizer
|
||||
beforeModel() {
|
||||
loadScript('defer/html-sanitizer-bundle');
|
||||
},
|
||||
|
||||
model() {
|
||||
return this.store.find('queuedPost', {status: 'new'});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue