Files
IPB/system/3rd_party/php-punycode/polyfill.php
T
2025-12-19 05:42:01 -08:00

21 lines
423 B
PHP

<?php
// HTMLPurifier will automatically use http://php.net/idn_to_ascii if
// the IDN extension is installed. This is a small Polyfill to declare
// that method and use the php-punycode library so that IDNs can be
// supported in all environments
function idn_to_ascii( $string )
{
$punycode = new \TrueBV\Punycode;
try
{
return $punycode->encode( $string );
}
catch ( \Exception $e )
{
return $string;
}
}