encode special characters when saving device details #644🚑

This commit is contained in:
jokob-sk
2024-04-22 07:37:31 +10:00
parent b0f1f581dc
commit 9cef7848c5
3 changed files with 8 additions and 8 deletions

View File

@@ -1443,15 +1443,15 @@ function setDeviceData (direction='', refreshCallback='') {
// update data to server
$.get('php/server/devices.php?action=setDeviceData&mac='+ mac
+ '&name=' + $('#txtName').val()
+ '&owner=' + $('#txtOwner').val()
+ '&name=' + encodeURIComponent($('#txtName').val())
+ '&owner=' + encodeURIComponent($('#txtOwner').val())
+ '&type=' + $('#txtDeviceType').val()
+ '&vendor=' + $('#txtVendor').val()
+ '&vendor=' + encodeURIComponent($('#txtVendor').val())
+ '&icon=' + encodeURIComponent($('#txtIcon').val())
+ '&favorite=' + ($('#chkFavorite')[0].checked * 1)
+ '&group=' + $('#txtGroup').val()
+ '&location=' + $('#txtLocation').val()
+ '&comments=' + $('#txtComments').val()
+ '&group=' + encodeURIComponent($('#txtGroup').val())
+ '&location=' + encodeURIComponent($('#txtLocation').val())
+ '&comments=' + encodeURIComponent($('#txtComments').val())
+ '&networknode=' + $('#txtNetworkNodeMac').attr('data-mynodemac')
+ '&networknodeport=' + $('#txtNetworkPort').val()
+ '&staticIP=' + ($('#chkStaticIP')[0].checked * 1)

View File

@@ -9,7 +9,7 @@
### Notes
The first run will take a while, subsequent should be much faster because new sensors don't have to be created anymore. A bit of background:
The first run will take a while, subsequent should be much faster because new sensors don't have to be created anymore. If the first sync times out, try to increase the timeout setting (default: 10s per device). A bit of background:
1. The app keeps a hash of the sensors. The hash includes:
- deviceId: Unique identifier for the device associated with the sensor.

View File

@@ -332,7 +332,7 @@
{
"function": "RUN_TIMEOUT",
"type": "integer",
"default_value": 10,
"default_value": 20,
"options": [],
"localized": ["name", "description"],
"name" : [{