• Модуль: security
  • Путь к файлу: ~/bitrix/modules/security/lib/filter/request.php
  • Класс: BitrixSecurityFilterRequest
  • Вызов: Request::filterArray
protected function filterArray($context, ?array $array, $name, $skipKeyPreg = '')
{
	if (!is_array($array))
	{
		return null;
	}

	foreach($array as $key => $value)
	{
		if ($skipKeyPreg && preg_match($skipKeyPreg, $key))
			continue;

		$filteredKey =  $this->filterVar($context, $key, "{$name}['{$key}']");
		if ($filteredKey != $key)
		{
			unset($array[$key]);
			$key = $filteredKey;
		}

		if (is_array($value))
		{
			$array[$key] = $this->filterArray($context, $value, "{$name}['{$key}']", $skipKeyPreg);
		}
		else
		{
			$array[$key] = $this->filterVar($context, $value, "{$name}['{$key}']");
		}
	}
	return $array;
}