uses existing function for escaping Overpass data; escape keys too (#575)
This commit is contained in:
parent
f68d32b1f2
commit
e058802777
1 changed files with 5 additions and 3 deletions
|
|
@ -255,12 +255,14 @@ BR.LayersConfig = L.Class.extend({
|
||||||
output += '</thead>';
|
output += '</thead>';
|
||||||
|
|
||||||
output += '<tbody>';
|
output += '<tbody>';
|
||||||
for (const key in overpassData.tags) {
|
for (let key in overpassData.tags) {
|
||||||
if (key.substring(0, 5) === 'addr:') {
|
if (key.substring(0, 5) === 'addr:') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// `new Option().innerHTML` escapes HTML entities for XSS protection
|
|
||||||
let value = new Option(overpassData.tags[key]).innerHTML;
|
let value = BR.Util.sanitizeHTMLContent(overpassData.tags[key]);
|
||||||
|
key = BR.Util.sanitizeHTMLContent(key);
|
||||||
|
|
||||||
if (key.match(/email/)) {
|
if (key.match(/email/)) {
|
||||||
value = '<a href="mailto:' + value + '">' + value + '</a>';
|
value = '<a href="mailto:' + value + '">' + value + '</a>';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue