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

PHP Warning: in_array() expects parameter 2 to be array, string given

    XMLWordPrintable

Details

    • Team B
    • Sprint 78 (Jul 2021)
    • 0.25

    Description

      My zabbix 5.0 is logging this error to Apache error.log:

      PHP Warning:  in_array() expects parameter 2 to be array, string given in /www/5.0/ui/include/classes/api/CApiService.php on line 262
      

      Note in version 5.2 line number is different, let me post it here for better searching too:

      PHP Warning:  in_array() expects parameter 2 to be array, string given in /www/5.2/ui/include/classes/api/CApiService.php on line 269
      

      To reproduce, execute an API request, where define output this way:

      "output":"hostid"
      

      Yes, this is not an array by mistake, but this API works.

      And the main issue here is PHP error which is unclear where it comes from and make zabbix users scary!

      Reproduced starting from 5.0 - checked.

      Fix it please.

      Attachments

        Issue Links

          Activity

            People

              sasha Alexander Vladishev
              zalex_ua Oleksii Zagorskyi
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: