first version
This commit is contained in:
27
kirby/src/Http/Idn.php
Executable file
27
kirby/src/Http/Idn.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Kirby\Http;
|
||||
|
||||
use TrueBV\Punycode;
|
||||
|
||||
/**
|
||||
* Handles Internationalized Domain Names
|
||||
*
|
||||
* @package Kirby Http
|
||||
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
*/
|
||||
class Idn
|
||||
{
|
||||
public static function decode(string $domain)
|
||||
{
|
||||
return (new Punycode())->decode($domain);
|
||||
}
|
||||
|
||||
public static function encode(string $domain)
|
||||
{
|
||||
return (new Punycode())->encode($domain);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user