XSS fix (layers name)

This commit is contained in:
viliusle 2023-12-01 15:05:05 +02:00
parent 1fce319dc9
commit f22cb46515
2 changed files with 8 additions and 2 deletions

View File

@ -164,7 +164,9 @@ class GUI_layers_class {
html += ' <button class="arrow_down" data-id="' + value.id + '" ></button>';
}
html += ' <button class="layer_name" id="layer_name" data-id="' + value.id + '">' + value.name + '</button>';
var layer_title = this.Helper.escapeHtml(value.name);
html += ' <button class="layer_name" id="layer_name" data-id="' + value.id + '">' + layer_title + '</button>';
html += ' <div class="clear"></div>';
html += '</div>';

View File

@ -2,21 +2,25 @@ import app from './../../app.js';
import config from './../../config.js';
import Base_layers_class from './../../core/base-layers.js';
import Dialog_class from './../../libs/popup.js';
import Helper_class from './../../libs/helpers.js';
class Layer_rename_class {
constructor() {
this.Base_layers = new Base_layers_class();
this.POP = new Dialog_class();
this.Helper = new Helper_class();
}
rename(id = null) {
var _this = this;
var name_ = this.Helper.escapeHtml(config.layer.name);
var settings = {
title: 'Rename',
params: [
{name: "name", title: "Name:", value: config.layer.name},
{name: "name", title: "Name:", value: name_},
],
on_load: function () {
document.querySelector('#pop_data_name').select();