Remove HTML sanitizer

This commit is contained in:
James Lyne 2021-01-06 00:59:27 +00:00
parent a2942b6400
commit 4cc1f8fd1f
2 changed files with 5 additions and 9 deletions

View File

@ -12,7 +12,6 @@
"vue": "^3.0.0" "vue": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@esri/arcgis-html-sanitizer": "^2.5.0",
"@types/clipboard": "^2.0.1", "@types/clipboard": "^2.0.1",
"@types/leaflet": "^1.5.19", "@types/leaflet": "^1.5.19",
"@typescript-eslint/eslint-plugin": "^4.1.0", "@typescript-eslint/eslint-plugin": "^4.1.0",

View File

@ -34,11 +34,8 @@ import {
DynmapWorld, DynmapWorld,
DynmapWorldMap DynmapWorldMap
} from "@/dynmap"; } from "@/dynmap";
import {Sanitizer} from "@esri/arcgis-html-sanitizer";
import {useStore} from "@/store"; import {useStore} from "@/store";
const sanitizer = new Sanitizer();
function buildServerConfig(response: any): DynmapServerConfig { function buildServerConfig(response: any): DynmapServerConfig {
return { return {
version: response.dynmapversion || '', version: response.dynmapversion || '',
@ -460,8 +457,8 @@ function buildUpdates(data: Array<any>): DynmapUpdates {
updates.chat.push({ updates.chat.push({
type: 'chat', type: 'chat',
playerAccount: entry.account, playerAccount: entry.account,
playerName: entry.playerName ? sanitizer.sanitize(entry.playerName) : "", playerName: entry.playerName || "",
message: entry.message ? sanitizer.sanitize(entry.message) : "", message: entry.message || "",
timestamp: entry.timestamp, timestamp: entry.timestamp,
channel: entry.channel || undefined, channel: entry.channel || undefined,
}); });
@ -481,7 +478,7 @@ function buildUpdates(data: Array<any>): DynmapUpdates {
updates.chat.push({ updates.chat.push({
type: 'playerjoin', type: 'playerjoin',
playerAccount: entry.account, playerAccount: entry.account,
playerName: entry.playerName ? sanitizer.sanitize(entry.playerName) : "", playerName: entry.playerName || "",
timestamp: entry.timestamp || undefined, timestamp: entry.timestamp || undefined,
}); });
break; break;
@ -500,7 +497,7 @@ function buildUpdates(data: Array<any>): DynmapUpdates {
updates.chat.push({ updates.chat.push({
type: 'playerleave', type: 'playerleave',
playerAccount: entry.account, playerAccount: entry.account,
playerName: entry.playerName ? sanitizer.sanitize(entry.playerName) : "", playerName: entry.playerName || "",
timestamp: entry.timestamp || undefined, timestamp: entry.timestamp || undefined,
}); });
break; break;
@ -578,7 +575,7 @@ export default {
account: player.account || "", account: player.account || "",
health: player.health || 0, health: player.health || 0,
armor: player.armor || 0, armor: player.armor || 0,
name: player.name ? sanitizer.sanitize(player.name) : "", name: player.name || "",
sort: player.sort || 0, sort: player.sort || 0,
hidden: !world, hidden: !world,
location: { location: {