Source
CProfile::updateArray('web.charts.subfilter.tagnames', $this->getInput('subfilter_tagnames', []), PROFILE_TYPE_STR);
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* Class to handle "charts.view" requests.
*/
class CControllerChartsView extends CControllerCharts {
protected function init() {
$this->disableCsrfValidation();
}
protected function checkInput() {
$fields = [
'from' => 'range_time',
'to' => 'range_time',
'view_as' => 'in '.HISTORY_GRAPH.','.HISTORY_VALUES,
'filter_set' => 'in 1',
'filter_rst' => 'in 1',
'filter_hostids' => 'array_id',
'filter_name' => 'string',
'filter_show' => 'in '.GRAPH_FILTER_ALL.','.GRAPH_FILTER_HOST.','.GRAPH_FILTER_SIMPLE,
'subfilter_set' => 'in 1',
'subfilter_tagnames' => 'array',
'subfilter_tags' => 'array',
'page' => 'ge 1'
];
$ret = $this->validateInput($fields) && $this->validateTimeSelectorPeriod();
if ($ret && $this->hasInput('subfilter_tagnames')) {
$tagnames = $this->getInput('subfilter_tagnames', []);
$ret = !$tagnames || count($tagnames) == count(array_filter($tagnames, 'is_string'));
}
if ($ret && $this->hasInput('subfilter_tags')) {
$tags = $this->getInput('subfilter_tags', []);
foreach ($tags as $tag => $values) {
if (!is_scalar($tag) || !is_array($values)
|| count($values) != count(array_filter($values, 'is_string'))) {
$ret = false;
break;
}
}
}
if (!$ret) {
$this->setResponse(new CControllerResponseFatal());
}