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

Runtime error appears if inventory field or tags operator is passed without an array

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.30, 6.0.12, 6.2.7rc1, 6.4.0beta6
    • Frontend (F)

      Case 1: Runtime error appears if inventory field or tags operator is passed without an array

      Steps to reproduce:

      • Open URLs:
        URL:/zabbix.php?show=1&name=&inventory[field]=type&inventory[0][value]=&evaltype=0&tags[0][tag]=&tags[0][operator]=0&tags[0][value]=&show_tags=3&tag_name_format=0&tag_priority=&show_opdata=0&show_timeline=1&filter_name=&filter_show_counter=0&filter_custom_time=0&sort=clock&sortorder=DESC&age_state=0&show_suppressed=0&unacknowledged=0&compact_view=0&details=0&highlight_row=0&action=problem.view
        
        OR
        
        URL:/zabbix.php?show=1&name=&inventory[0][field]=type&inventory[0][value]=&evaltype=0&tags[tag]=&tags[0][operator]=0&tags[0][value]=&show_tags=3&tag_name_format=0&tag_priority=&show_opdata=0&show_timeline=1&filter_name=&filter_show_counter=0&filter_custom_time=0&sort=clock&sortorder=DESC&age_state=0&show_suppressed=0&unacknowledged=0&compact_view=0&details=0&highlight_row=0&action=problem.view
        
      • Check errors

      Result: runtime errors appear

      count(): Parameter must be an array or an object that implements Countable [zabbix.php:22 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerProblemView->checkInput() -> CControllerProblem->validateInventory() -> CConfigFile->{closure}() in app/controllers/CControllerProblem.php:174]
      count(): Parameter must be an array or an object that implements Countable [zabbix.php:22 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerProblemView->checkInput() -> CControllerProblem->validateTags() -> CConfigFile->{closure}() in app/controllers/CControllerProblem.php:197]
      


      Expected: error handling should be applied.

      Note: MOVED from DEV-2085 subissue #49

      Case 2: Undefined index errors appear if an empty array is passed instead of [0]

      Steps to reproduce:

      • Open e.g. hosts filter and press apply
      • Remove array value 0 for 'tags' parameters e.g.
      URL:/zabbix.php?action=host.list&filter_host=&filter_dns=&filter_ip=&filter_port=&filter_monitored_by=0&filter_evaltype=0&filter_tags[][tag]=&filter_tags[][operator]=0&filter_tags[][value]=&filter_set=1
      

      Result:

      Undefined index: value [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:83]
      Undefined index: value [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:88]
      Undefined index: operator [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:89]
      Undefined index: tag [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:83]
      Undefined index: tag [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:87]
      Undefined index: value [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:88]
      Undefined index: tag [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:83]
      Undefined index: tag [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:87]
      Undefined index: operator [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostList->doAction() in app/controllers/CControllerHostList.php:89]
      


      Expected: error handling should be applied.

            zabbix.dev Zabbix Development Team
            kseve Kirils Seve
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: