Conditions | 3 |
Paths | 3 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | public static function isValid($host) |
||
27 | { |
||
28 | return preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $host) //valid chars check |
||
29 | && preg_match('/^.{1,253}$/', $host) //overall length check |
||
30 | && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $host) //length of each label |
||
31 | ; |
||
32 | } |
||
33 | |||
51 |