Merge pull request #2823 from chakflying/fix/footer-null

Fix: Add null check for injected HTML
This commit is contained in:
Louis Lam 2023-02-23 18:03:33 +08:00 committed by GitHub
commit 6235ce6b29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -502,15 +502,27 @@ export default {
}, },
incidentHTML() { incidentHTML() {
if (this.incident.content != null) {
return DOMPurify.sanitize(marked(this.incident.content)); return DOMPurify.sanitize(marked(this.incident.content));
} else {
return "";
}
}, },
descriptionHTML() { descriptionHTML() {
if (this.config.description != null) {
return DOMPurify.sanitize(marked(this.config.description)); return DOMPurify.sanitize(marked(this.config.description));
} else {
return "";
}
}, },
footerHTML() { footerHTML() {
if (this.config.footerText != null) {
return DOMPurify.sanitize(marked(this.config.footerText)); return DOMPurify.sanitize(marked(this.config.footerText));
} else {
return "";
}
}, },
}, },
watch: { watch: {