Added “pattmods” function argument
This commit is contained in:
parent
c61e9ceecc
commit
768cbc0aec
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
function validhostname($inp) {
|
||||
function validhostname($inp,$pattmods='') {
|
||||
if (strlen($inp)>253)
|
||||
return(false);
|
||||
$inp=explode('.',$inp);
|
||||
|
@ -7,7 +7,7 @@ function validhostname($inp) {
|
|||
$len=strlen($lab);
|
||||
if ($len==0 || $len>63)
|
||||
return(false);
|
||||
if (preg_match('#^[a-z0-9]([a-z0-9-]*[a-z0-9])?$#',$lab)!==1)
|
||||
if (preg_match('#^[a-z0-9]([a-z0-9-]*[a-z0-9])?$#'.$pattmods,$lab)!==1)
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
|
|
Loading…
Reference in a new issue