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

    • Type: Problem report
    • Status: Confirmed
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.0.8, 5.2.5
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:
      None

      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

              Assignee:
              zabbix.dev Zabbix Development Team
              Reporter:
              zalex_ua Oleksii Zagorskyi
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: