• Модуль: security
  • Путь к файлу: ~/bitrix/modules/security/lib/hostrestriction.php
  • Класс: BitrixSecurityHostRestriction
  • Вызов: HostRestriction::genValidationRegExp
protected function genValidationRegExp($hosts)
{
	$hosts = preg_replace('/#.*/', '', $hosts);
	$hosts = trim($hosts, " tnr");
	$hosts = preg_quote($hosts);
	$hosts = preg_replace('~\\*~', '.*', $hosts);
	$hosts = preg_split('~s+~s', $hosts);

	foreach ($hosts as $i => $host)
	{
		$hosts[$i] = "#^s*($host)(:d+)?s*$#iD";
	}
	return $hosts;
}