-
Problem report
-
Resolution: Duplicate
-
Trivial
-
None
-
7.0.7
-
None
-
Zabbix 7.0.7 on RHEL8
Description:
Script item parameters are wrongly escaped if set via user macro.
Steps to reproduce:
Create host and script item with parameter "urls" with value '["https://www.srv1.com","https://www.srv2.com"]'. The javascript vill be simply:
return value;
This approach returs in item latest data correct expected value:
{"urls":"[\"https://www.srv1.com\",\"https://www.srv2.com\"]"}
Now define on the host user macro {$URLS} with the same parameter value and use this macro for item parameter value.
Now the item last value will be:
{"urls":"[\\\"https://www.srv1.com\\\",\\\"https://www.srv2.com\\\"]"}
There are added additional backslashes for each doublequote in parameter value.
Expected:
The value returned for the script item will be correctly escaped if user macro is used for item parameter.
Maybe this problem have something in common with existimg issue ZBX-24970