Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-21615

Backslash is not escaped in macro value when it's resolved in trigger expression string parameter

    XMLWordPrintable

Details

    • Team C
    • Sprint 92 (Sep 2022)
    • 0.25

    Description

      Problem description: if macro value contains an escape symbol (backslash) and double quotes, and this macro is used in a string parameter of a trigger expression (or in calculated item formula), then the double quotes are escaped in the resolved macro value, but the escape symbol is not.

      Steps to reproduce:

      1. Create a host with a numeric item
      2. Add host macro that contains both double quotes and a backslash in its value, for example: "\aaa"
      3. Add a trigger with function find() and use this host macro in parameter "V", like so:
         find(/test/trap,5h,"eq",{$A})=0 
      4. Send some numeric value to the previously created item
      5. Check the error message in the list of triggers

      Result: In the error message he double quotes are escaped, but the backslash is not:

      Cannot evaluate function find(/test/trap,5h,"eq","\"\aaa\""): ""\aaa"" is not a valid numeric float value.
      

      Expected: the backslash should be escaped, same as the double quotes.

      Attachments

        Issue Links

          Activity

            People

              zabbix.dev Zabbix Development Team
              solonkins Sergejs Olonkins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: