diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..485dee6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea
diff --git a/appinfo/database.xml b/appinfo/database.xml
deleted file mode 100644
index 71a37ee..0000000
--- a/appinfo/database.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
- *dbname*
- true
- false
- utf8
-
- *dbprefix*gpxedit_tile_servers
-
-
- id
- integer
- 0
- true
- 1
- 4
-
-
- user
- text
- true
- 64
-
-
- type
- text
- tile
- true
- 20
-
-
- servername
- text
- true
- 300
-
-
- url
- text
- true
- 300
-
-
- format
- text
- true
- image/jpeg
- 300
-
-
- layers
- text
- true
-
- 300
-
-
- version
- text
- true
- 1.1.1
- 30
-
-
- opacity
- text
- true
- 0.4
- 10
-
-
- transparent
- text
- true
- true
- 10
-
-
- minzoom
- integer
- true
- 1
- 4
-
-
- maxzoom
- integer
- true
- 18
- 4
-
-
- attribution
- text
- true
- ???
- 300
-
-
-
-
- *dbprefix*gpxedit_options
-
-
- id
- integer
- 0
- true
- 1
- 4
-
-
- user
- text
- true
- 64
-
-
- jsonvalues
- clob
- true
-
-
-
-
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 69b95ad..6718219 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -3,7 +3,7 @@
gpxedit
GpxEdit
- 0.0.13
+ 0.0.14
agpl
Julien Veyssier
GpxEdit
@@ -23,7 +23,7 @@
pgsql
sqlite
mysql
-
+
OCA\GpxEdit\Settings\Admin
diff --git a/js/gpxedit.js b/js/gpxedit.js
index 2d23d1c..3a0784a 100644
--- a/js/gpxedit.js
+++ b/js/gpxedit.js
@@ -178,6 +178,17 @@
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
+ function escapeHtml(text) {
+ const map = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ }
+ return text.replace(/[&<>"']/g, (m) => { return map[m] })
+ }
+
function load_map() {
// change meta to send referrer
// usefull for IGN tiles authentication !
@@ -628,11 +639,11 @@
gpxText = gpxText + '\n \n';
var trackName = $('#tracknameinput').val();
if (trackName) {
- gpxText = gpxText + ' ' + escapeHTML(trackName) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(trackName) + '\n';
}
var fileDesc = $('#desctext').val();
if (fileDesc) {
- gpxText = gpxText + ' ' + escapeHTML(fileDesc) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(fileDesc) + '\n';
}
var linkurl = $('#linkurlinput').val();
if (linkurl) {
@@ -640,7 +651,7 @@
var linktext = $('#linktextinput').val();
if (linktext) {
- gpxText = gpxText + ' ' + escapeHTML(linktext) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(linktext) + '\n';
}
gpxText = gpxText + ' \n';
}
@@ -720,7 +731,7 @@
alt = layer._latlng.alt;
gpxText = gpxText + ' \n';
if (name) {
- gpxText = gpxText + ' ' + escapeHTML(name) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(name) + '\n';
}
else{
gpxText = gpxText + ' \n';
@@ -729,16 +740,16 @@
gpxText = gpxText + ' ' + alt + '\n';
}
if (linkText && linkUrl) {
- gpxText = gpxText + ' ' + escapeHTML(linkText) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(linkText) + '\n';
}
if (comment) {
- gpxText = gpxText + ' ' + escapeHTML(comment) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(comment) + '\n';
}
if (symbol) {
gpxText = gpxText + ' ' + symbol + '\n';
}
if (description) {
- gpxText = gpxText + ' ' + escapeHTML(description) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(description) + '\n';
}
if (time) {
gpxText = gpxText + ' \n';
@@ -748,19 +759,19 @@
else if(!layer.type || layer.type === 'track') {
gpxText = gpxText + ' \n';
if (name) {
- gpxText = gpxText + ' ' + escapeHTML(name) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(name) + '\n';
}
else{
gpxText = gpxText + ' \n';
}
if (comment) {
- gpxText = gpxText + ' ' + escapeHTML(comment) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(comment) + '\n';
}
if (linkText && linkUrl) {
- gpxText = gpxText + ' ' + escapeHTML(linkText) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(linkText) + '\n';
}
if (description) {
- gpxText = gpxText + ' ' + escapeHTML(description) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(description) + '\n';
}
gpxText = gpxText + ' \n';
for (i = 0; i < layer._latlngs.length; i++) {
@@ -782,19 +793,19 @@
else if(layer.type === 'route') {
gpxText = gpxText + ' \n';
if (name) {
- gpxText = gpxText + ' ' + escapeHTML(name) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(name) + '\n';
}
else{
gpxText = gpxText + ' \n';
}
if (comment) {
- gpxText = gpxText + ' ' + escapeHTML(comment) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(comment) + '\n';
}
if (linkText && linkUrl) {
- gpxText = gpxText + ' ' + escapeHTML(linkText) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(linkText) + '\n';
}
if (description) {
- gpxText = gpxText + ' ' + escapeHTML(description) + '\n';
+ gpxText = gpxText + ' ' + escapeHtml(description) + '\n';
}
for (i = 0; i < layer._latlngs.length; i++) {
lat = layer._latlngs[i].lat;
@@ -1294,9 +1305,9 @@
}).done(function (response) {
if (response.done) {
$('#'+type+'serverlist ul').prepend(
- '' +
- escapeHTML(sname) + '