Idna
in package
Tags
Table of Contents
- ERROR_BIDI = 0x800
- ERROR_CONTEXTJ = 0x1000
- ERROR_CONTEXTO_DIGITS = 0x4000
- ERROR_CONTEXTO_PUNCTUATION = 0x2000
- ERROR_DISALLOWED = 0x80
- ERROR_DOMAIN_NAME_TOO_LONG = 4
- ERROR_EMPTY_LABEL = 1
- ERROR_HYPHEN_3_4 = 0x20
- ERROR_INVALID_ACE_LABEL = 0x400
- ERROR_LABEL_HAS_DOT = 0x200
- ERROR_LABEL_TOO_LONG = 2
- ERROR_LEADING_COMBINING_MARK = 0x40
- ERROR_LEADING_HYPHEN = 8
- ERROR_NONE = 0
- IDNA errors.
- ERROR_PUNYCODE = 0x100
- ERROR_TRAILING_HYPHEN = 0x10
- IDNA2008_ASCII = self::IDNA_NONTRANSITIONAL_TO_ASCII | self::IDNA_CHECK_BIDI | self::IDNA_USE_STD3_RULES | self::IDNA_CHECK_CONTEXTJ
- IDNA default options.
- IDNA2008_UNICODE = self::IDNA_NONTRANSITIONAL_TO_UNICODE | self::IDNA_CHECK_BIDI | self::IDNA_USE_STD3_RULES | self::IDNA_CHECK_CONTEXTJ
- IDNA_ALLOW_UNASSIGNED = 1
- IDNA_CHECK_BIDI = 4
- IDNA_CHECK_CONTEXTJ = 8
- IDNA_CHECK_CONTEXTO = 0x40
- IDNA_DEFAULT = 0
- IDNA options.
- IDNA_NONTRANSITIONAL_TO_ASCII = 0x10
- IDNA_NONTRANSITIONAL_TO_UNICODE = 0x20
- IDNA_USE_STD3_RULES = 2
- MAX_DOMAIN_LENGTH = 253
- MAX_LABEL_LENGTH = 63
- REGEXP_IDNA_PATTERN = '/[^\x20-\x7f]/'
- REGEXP_REGISTERED_NAME = '/ (?(DEFINE) (?<unreserved>[a-z0-9_~\-]) # . is missing as it is used to separate labels (?<sub_delims>[!$&'()*+,;=]) (?<encoded>%[A-F0-9]{2}) (?<reg_name>(?:(?&unreserved)|(?&sub_delims)|(?&encoded))*) ) ^(?:(?®_name)\.)*(?®_name)\.?$ /ix'
- General registered name regular expression.
- toAscii() : IdnaInfo
- Converts the input to its IDNA ASCII form.
- toUnicode() : IdnaInfo
- Converts the input to its IDNA UNICODE form.
- supportsIdna() : void
- validateDomainAndLabelLength() : int
- Adapted from https://github.com/TRowbotham/idna.
Constants
ERROR_BIDI
public
mixed
ERROR_BIDI
= 0x800
ERROR_CONTEXTJ
public
mixed
ERROR_CONTEXTJ
= 0x1000
ERROR_CONTEXTO_DIGITS
public
mixed
ERROR_CONTEXTO_DIGITS
= 0x4000
ERROR_CONTEXTO_PUNCTUATION
public
mixed
ERROR_CONTEXTO_PUNCTUATION
= 0x2000
ERROR_DISALLOWED
public
mixed
ERROR_DISALLOWED
= 0x80
ERROR_DOMAIN_NAME_TOO_LONG
public
mixed
ERROR_DOMAIN_NAME_TOO_LONG
= 4
ERROR_EMPTY_LABEL
public
mixed
ERROR_EMPTY_LABEL
= 1
ERROR_HYPHEN_3_4
public
mixed
ERROR_HYPHEN_3_4
= 0x20
ERROR_INVALID_ACE_LABEL
public
mixed
ERROR_INVALID_ACE_LABEL
= 0x400
ERROR_LABEL_HAS_DOT
public
mixed
ERROR_LABEL_HAS_DOT
= 0x200
ERROR_LABEL_TOO_LONG
public
mixed
ERROR_LABEL_TOO_LONG
= 2
ERROR_LEADING_COMBINING_MARK
public
mixed
ERROR_LEADING_COMBINING_MARK
= 0x40
ERROR_LEADING_HYPHEN
public
mixed
ERROR_LEADING_HYPHEN
= 8
ERROR_NONE
IDNA errors.
public
mixed
ERROR_NONE
= 0
ERROR_PUNYCODE
public
mixed
ERROR_PUNYCODE
= 0x100
ERROR_TRAILING_HYPHEN
public
mixed
ERROR_TRAILING_HYPHEN
= 0x10
IDNA2008_ASCII
IDNA default options.
public
mixed
IDNA2008_ASCII
= self::IDNA_NONTRANSITIONAL_TO_ASCII | self::IDNA_CHECK_BIDI | self::IDNA_USE_STD3_RULES | self::IDNA_CHECK_CONTEXTJ
IDNA2008_UNICODE
public
mixed
IDNA2008_UNICODE
= self::IDNA_NONTRANSITIONAL_TO_UNICODE | self::IDNA_CHECK_BIDI | self::IDNA_USE_STD3_RULES | self::IDNA_CHECK_CONTEXTJ
IDNA_ALLOW_UNASSIGNED
public
mixed
IDNA_ALLOW_UNASSIGNED
= 1
IDNA_CHECK_BIDI
public
mixed
IDNA_CHECK_BIDI
= 4
IDNA_CHECK_CONTEXTJ
public
mixed
IDNA_CHECK_CONTEXTJ
= 8
IDNA_CHECK_CONTEXTO
public
mixed
IDNA_CHECK_CONTEXTO
= 0x40
IDNA_DEFAULT
IDNA options.
public
mixed
IDNA_DEFAULT
= 0
IDNA_NONTRANSITIONAL_TO_ASCII
public
mixed
IDNA_NONTRANSITIONAL_TO_ASCII
= 0x10
IDNA_NONTRANSITIONAL_TO_UNICODE
public
mixed
IDNA_NONTRANSITIONAL_TO_UNICODE
= 0x20
IDNA_USE_STD3_RULES
public
mixed
IDNA_USE_STD3_RULES
= 2
MAX_DOMAIN_LENGTH
private
mixed
MAX_DOMAIN_LENGTH
= 253
MAX_LABEL_LENGTH
private
mixed
MAX_LABEL_LENGTH
= 63
REGEXP_IDNA_PATTERN
private
mixed
REGEXP_IDNA_PATTERN
= '/[^\x20-\x7f]/'
REGEXP_REGISTERED_NAME
General registered name regular expression.
private
mixed
REGEXP_REGISTERED_NAME
= '/
(?(DEFINE)
(?<unreserved>[a-z0-9_~\-]) # . is missing as it is used to separate labels
(?<sub_delims>[!$&'()*+,;=])
(?<encoded>%[A-F0-9]{2})
(?<reg_name>(?:(?&unreserved)|(?&sub_delims)|(?&encoded))*)
)
^(?:(?®_name)\.)*(?®_name)\.?$
/ix'
Tags
Methods
toAscii()
Converts the input to its IDNA ASCII form.
public
static toAscii(string $domain, int $options) : IdnaInfo
This method returns the string converted to IDN ASCII form
Parameters
- $domain : string
- $options : int
Tags
Return values
IdnaInfo —toUnicode()
Converts the input to its IDNA UNICODE form.
public
static toUnicode(string $domain, int $options) : IdnaInfo
This method returns the string converted to IDN UNICODE form
Parameters
- $domain : string
- $options : int
Tags
Return values
IdnaInfo —supportsIdna()
private
static supportsIdna() : void
Tags
Return values
void —validateDomainAndLabelLength()
Adapted from https://github.com/TRowbotham/idna.
private
static validateDomainAndLabelLength(string $domain) : int
Parameters
- $domain : string