• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/punycode.php
  • Класс: CBXPunycode
  • Вызов: CBXPunycode::IsEncoded
public function IsEncoded($domainName)
{
	$this->ClearErrors();

	$domainName = mb_strtolower(trim($domainName));

	$schemePosition = mb_strpos($domainName, "://");
	if ($schemePosition !== false)
		$domainName = mb_substr($domainName, $schemePosition + 3);

	if ($this->encoding != "utf-8")
		$domainName = BitrixMainTextEncoding::convertEncoding($domainName, $this->encoding, "utf-8");

	$domainNameUcs4 = $this->Utf8ToUcs4($domainName);
	if (empty($domainNameUcs4))
		return false;

	$arDomainNameUcs4 = $this->ExplodeDomainName($domainNameUcs4);

	foreach ($arDomainNameUcs4 as $value)
	{
		$checked = array_slice($value, 0, self::$punycodePrefixLength);
		if (self::$punycodePrefixUcs4 == $checked)
			return true;
	}

	return false;
}