-
Problem report
-
Resolution: Cannot Reproduce
-
Trivial
-
None
-
5.4.3
-
None
Steps to reproduce:
- Create Script item type with some parameter having value e.g. {$TEST_MACRO} and code e.g.:
var script_params = JSON.parse(value); return JSON.stringify(script_params);
- Fill user macro {$TEST_MACRO} with doublequoted value, e.g. "SUBMITTED", or "SUBMITTED","REPEATED", and so on.
- Initiate item execution and see it in latest data.
Result:
Cannot execute script: SyntaxError: invalid json (at offset 17)
at [anon] (duktape.c:34562) internal
at parse () native strict preventsyield
at [anon] (function:1) preventsyield
Expected:
The same as when doublequoted value in script parameter directly (not via user macro), but directly it is working without error, e.g.:
I haven't found in documentation https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/script that these two cases should have different parameter parsing / escaping ...
- is duplicated by
-
ZBX-18804 Macros are not escaped in script item parameters
- Closed