ioBroker / ioBroker.admin

user interface for configuration and administration
https://iobroker.net
MIT License
273 stars 78 forks source link

[bug]: JSONConfig sendTo jsonData attribute parser problem #2778

Open Jey-Cee opened 3 weeks ago

Jey-Cee commented 3 weeks ago

No existing issues.

Describe the bug

If a data field includes a \ and is added to jsonData the string can not parsed correct. This leads to an error and throws a message in Browser.

To Reproduce

Create a JSONConfig with a text input and sendTo where the data from text input is included in jsonData string. Enter a \ in text input and hit the sendTo button. Then look into the browser console.

Expected behavior

The string has to be checked for regex characters and has to escape findings.

Screenshots & Logfiles

Cannot parse json data: {"subject": "Test des email adapters", "to": "christoph@all-smart.net", "from": "ioBroker", "text": "This is a test email from ioBroker!", "service": "", "options": { "host": "mail.all-smart.net", "port": "587", "secure": "false", "requireTLS": "true", "auth": {"user": "iobroker@all-smart.net", "pass": "\"} } }

Adapter version

7.2.6

js-controller version

7.0.1

Node version

v22.9.0

Operating system

Ubuntu

Additional context

No response

Jey-Cee commented 3 weeks ago

Use encodeURIComponent directly in jsonData as it is used in influxdb -> https://github.com/ioBroker/ioBroker.influxdb/blob/234de8d73a8e1b48aabce21d9133eb8a13af2956/admin/jsonConfig.json#L156