mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-02 07:41:49 +02:00
Sanitize and validate
This commit is contained in:
parent
0e135befc2
commit
e00a2985e9
6 changed files with 141 additions and 7 deletions
|
@ -274,6 +274,8 @@ class HostsController extends Controller
|
|||
$uri = $request->getUri()->getPath();
|
||||
|
||||
function isValidHostname($hostname) {
|
||||
$hostname = trim($hostname);
|
||||
|
||||
// Check for IDN and convert to ASCII if necessary
|
||||
if (mb_detect_encoding($hostname, 'ASCII', true) === false) {
|
||||
$hostname = idn_to_ascii($hostname, 0, INTL_IDNA_VARIANT_UTS46);
|
||||
|
@ -343,6 +345,8 @@ class HostsController extends Controller
|
|||
$uri = $request->getUri()->getPath();
|
||||
|
||||
function isValidHostname($hostname) {
|
||||
$hostname = trim($hostname);
|
||||
|
||||
// Check for IDN and convert to ASCII if necessary
|
||||
if (mb_detect_encoding($hostname, 'ASCII', true) === false) {
|
||||
$hostname = idn_to_ascii($hostname, 0, INTL_IDNA_VARIANT_UTS46);
|
||||
|
@ -541,6 +545,8 @@ class HostsController extends Controller
|
|||
$uri = $request->getUri()->getPath();
|
||||
|
||||
function isValidHostname($hostname) {
|
||||
$hostname = trim($hostname);
|
||||
|
||||
// Check for IDN and convert to ASCII if necessary
|
||||
if (mb_detect_encoding($hostname, 'ASCII', true) === false) {
|
||||
$hostname = idn_to_ascii($hostname, 0, INTL_IDNA_VARIANT_UTS46);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue