mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
escape translated strings to prevent HTML injections
This commit is contained in:
@ -1,6 +1,12 @@
|
||||
import DateTimeWrapper from './date-time-wrapper.js'
|
||||
|
||||
export default class Formatter {
|
||||
static escapeHTML(input) {
|
||||
const div = document.createElement('div')
|
||||
div.appendChild(document.createTextNode(input))
|
||||
return div.innerHTML
|
||||
}
|
||||
|
||||
static formatDate({ locale, timeZone, start, end, isShortOffsetNameShown }) {
|
||||
const startDateTime = new DateTimeWrapper({
|
||||
locale,
|
||||
|
Reference in New Issue
Block a user