HumHub Documentation (unofficial)

update_hostname_validator.php

Tags
see
https://github.com/laminas/laminas-validator

for the canonical source repository

copyright

https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md

license

https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License

Table of Contents

Constants

IANA_URL  = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt'
LAMINAS_HOSTNAME_VALIDATOR_FILE  = __DIR__ . '/../src/Hostname.php'

Functions

getOfficialTLDs()  : Response
Get Official TLDs
getVersionFromString()  : string
Extract the first match of a string like "Version 2015072300" from the given string
getNewValidTlds()  : array<int, string>
Extract new Valid TLDs from a string containing one per line.
getPunycodeDecoder()  : callable
Retrieve and return a punycode decoder.

Constants

LAMINAS_HOSTNAME_VALIDATOR_FILE

public mixed LAMINAS_HOSTNAME_VALIDATOR_FILE = __DIR__ . '/../src/Hostname.php'

Functions

getVersionFromString()

Extract the first match of a string like "Version 2015072300" from the given string

getVersionFromString(string $prefix, string $string) : string
Parameters
$prefix : string
$string : string
Tags
throws
Exception
Return values
string

getNewValidTlds()

Extract new Valid TLDs from a string containing one per line.

getNewValidTlds(string $string) : array<int, string>
Parameters
$string : string
Return values
array<int, string>

getPunycodeDecoder()

Retrieve and return a punycode decoder.

getPunycodeDecoder() : callable

TLDs are puny encoded.

We need a decodePunycode function to translate TLDs to UTF-8:

  • use idn_to_utf8 if available
  • otherwise, use Hostname::decodePunycode()
Return values
callable

        
On this page

Search results