fix CVE-2022-39299 (bump xmldom) (#820)
This commit is contained in:
@@ -11,7 +11,7 @@ import EasyFit from "$lib/vendor/easy-fit/easy-fit";
|
||||
import type { Feature, FeatureCollection, GeoJSON, GeoJsonProperties, Position } from 'geojson';
|
||||
import JSZip from "jszip";
|
||||
import type { AuthRecord } from "pocketbase";
|
||||
import * as xmldom from 'xmldom';
|
||||
import { DOMParser as XMLDOMParser } from "@xmldom/xmldom";
|
||||
import { bbox, splitMultiLineStringToLineStrings } from "./geojson_util";
|
||||
import { trails_show } from "$lib/stores/trail_store";
|
||||
import { handleFromRecordWithIRI } from "./activitypub_util";
|
||||
@@ -161,7 +161,7 @@ export async function fromFile(file: File | Blob) {
|
||||
}
|
||||
|
||||
export function fromKML(kmlData: string) {
|
||||
const parser = browser ? new DOMParser() : new xmldom.DOMParser();
|
||||
const parser = browser ? new DOMParser() : new XMLDOMParser();
|
||||
const nodes = parser.parseFromString(kmlData, "text/xml")
|
||||
const geojson = kml(nodes) as Feature | FeatureCollection
|
||||
|
||||
@@ -178,7 +178,7 @@ export async function fromKMZ(kmzData: ArrayBuffer) {
|
||||
}
|
||||
|
||||
export function fromTCX(tcxData: string) {
|
||||
const parser = browser ? new DOMParser() : new xmldom.DOMParser();
|
||||
const parser = browser ? new DOMParser() : new XMLDOMParser();
|
||||
const nodes = parser.parseFromString(tcxData, "text/xml")
|
||||
const geojson = tcx(nodes) as Feature | FeatureCollection
|
||||
|
||||
@@ -394,4 +394,4 @@ export function cropGPX(start: GPXWaypoint, end: GPXWaypoint, gpx: GPX): GPX {
|
||||
}).filter(track => track.trkseg.length > 0);
|
||||
|
||||
return new GPX({ ...gpx, trk: croppedTrk?.map(t => new Track({ ...t })) ?? [], })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user