• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/configuration/helper.php
  • Класс: BitrixRestConfigurationHelper
  • Вызов: Helper::sanitize
public function sanitize($value, &$bad = false, $splitter = ' ')
{
	if (!is_bool($bad))
	{
		$bad = false;
	}

	if ($this->sanitizer === null)
	{
		$this->sanitizer = false;
		if (Loader::includeModule('security'))
		{
			$this->sanitizer = new AuditorXss(
				$splitter
			);
		}
	}

	if ($this->sanitizer)
	{
		// bad value exists
		if (is_array($value))
		{
			foreach ($value as &$val)
			{
				$val = $this->sanitize($val, $bad, $splitter);
			}
			unset($val);
		}
		elseif ($this->sanitizer->process($value))
		{
			$bad = true;
			$value = $this->sanitizer->getFilteredValue();
		}
	}

	return $value;
}