• Модуль: security
  • Путь к файлу: ~/bitrix/modules/security/lib/hostrestriction.php
  • Класс: BitrixSecurityHostRestriction
  • Вызов: HostRestriction::checkNewHosts
protected function checkNewHosts($hosts)
{
	$this->validationRegExp = $this->genValidationRegExp($hosts);

	$count = 0;
	preg_replace($this->validationRegExp, '', $this->getTargetHost(), 1, $count);
	if (!$count)
		throw new LogicException('Current host blocked', 'SECURITY_HOSTS_SELF_BLOCK');

	$count = 0;
	preg_replace($this->validationRegExp, '', 'some-invalid-host.com', 1, $count);
	if ($count)
		throw new LogicException('Any host passed restrictions', 'SECURITY_HOSTS_ANY_HOST');

	return $this;
}