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

Error when applying subfilter by tag on graph page if item tag contains special characters

XMLWordPrintable

    • Technical backlog

      Steps to reproduce:

      1. Create item with tag value "],*,a[x=" 1
      2. Create graph
      3. Go to Monitoring -> Hosts -> select Graphs
      4. Apply subfilter by tag value
      5. Try unselect tag value in subfilter

      Result:
      blank page
      PHP runtime error

      TypeError: array_flip(): Argument #1 ($array) must be of type array, string given in /home/natalja/workspace/master/ui/app/controllers/CControllerCharts.php:204
      Stack trace:
      #0 /home/natalja/workspace/master/ui/app/controllers/CControllerCharts.php(204): array_flip()
      #1 /home/natalja/workspace/master/ui/app/controllers/CControllerChartsView.php(154): CControllerCharts::getSubfilterFields()
      #2 /home/natalja/workspace/master/ui/include/classes/mvc/CController.php(474): CControllerChartsView->doAction()
      #3 /home/natalja/workspace/master/ui/include/classes/core/ZBase.php(635): CController->run()
      #4 /home/natalja/workspace/master/ui/include/classes/core/ZBase.php(233): ZBase->processRequest()
      #5 /home/natalja/workspace/master/ui/include/config.inc.php(25): ZBase->run()
      #6 /home/natalja/workspace/master/ui/zabbix.php(22): require_once('...')
      #7 {main}
      

      If tag value contains single/double quotes or slashes,  js console error occurs:

      zabbix.php?action=charts.view&from=now-1h&to=now&filter_hostids%5B%5D=10594&filter_name=&filter_show=1&subfilter_tags%5Bone%5D%5B%5D=%5C%2F&subfilter_set=1:112 Uncaught TypeError: Cannot read properties of null (reading 'remove')
          at Object.unsetSubfilter (zabbix.php?action=charts.view&from=now-1h&to=now&filter_hostids%5B%5D=10594&filter_name=&filter_show=1&subfilter_tags%5Bone%5D%5B%5D=%5C%2F&subfilter_set=1:112:82)
          at HTMLFormElement.<anonymous> (zabbix.php?action=charts.view&from=now-1h&to=now&filter_hostids%5B%5D=10594&filter_name=&filter_show=1&subfilter_tags%5Bone%5D%5B%5D=%5C%2F&subfilter_set=1:62:11)
      


      Expected:
      no errors

            zabbix.dev Zabbix Development Team
            natalja.zabbix Natalja Romancaka
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: