Skip to content

Commit 44e98d0

Browse files
committed
Escape XML title
1 parent 195878e commit 44e98d0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tilepack/tms_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from collections.abc import Iterable
99
from dataclasses import dataclass, field
1010
from pathlib import Path
11+
from xml.sax.saxutils import escape
1112

1213
PNG_SIGNATURE = b"\x89PNG\r\n\x1a\n"
1314
EXT_RE = re.compile(r"\.(png|jpg|jpeg|webp)$", re.IGNORECASE)
@@ -206,7 +207,7 @@ def generate_tilemapresource_xml(
206207

207208
return f"""<?xml version="1.0" encoding="UTF-8"?>
208209
<TileMap version="1.0.0" tilemapservice="1.0.0">
209-
<Title>{title}</Title>
210+
<Title>{escape(title)}</Title>
210211
<Abstract/>
211212
<SRS>{srs}</SRS>
212213
<BoundingBox minx="{bb_minx:.10f}" miny="{bb_miny:.10f}" maxx="{bb_maxx:.10f}" maxy="{bb_maxy:.10f}"/>

0 commit comments

Comments
 (0)