Bug in trigger.get when filtering by array of hosts.

XMLWordPrintable

    • Type: Incident report
    • Resolution: Won't fix
    • Priority: Minor
    • 2.0.0
    • Affects Version/s: 1.8.5
    • Component/s: API (A)
    • Environment:
      SLES 11.1 64 bit, Apache 2, PHP5

      When filtering by host, only strings are recognized datatypes.

      "filter":

      { "host": 'hostname' }

      works whereas
      "filter":

      { "host": ['hostname'] }

      does not.

      This seems to be caused by class.ctrigger.php:441
      $sql_parts['where']['host'] = 'h.host='.zbx_dbstr($options['filter']['host']);

      Should be:
      $sql_parts['where']['host'] = DBcondition('h.host',$options['filter']['host'],false, true);

            Assignee:
            Unassigned
            Reporter:
            Luke MacNeil
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: