- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
public function passes($attribute, $hostname)
{
if (!mb_stripos($hostname, '.')) {
return false;
}
$domain = explode('.', $hostname);
$allowedChars = ['-'];
$extenion = array_pop($domain);
foreach ($domain as $value) {
$fc = mb_substr($value, 0, 1);
$lc = mb_substr($value, -1);
if (
hash_equals($value, '')
|| in_array($fc, $allowedChars)
|| in_array($lc, $allowedChars)
) {
return false;
}
if (!ctype_alnum(str_replace($allowedChars, '', $value))) {
return false;
}
}
if (
!ctype_alnum(str_replace($allowedChars, '', $extenion))
|| hash_equals($extenion, '')
) {
return false;
}
if (filter_var($hostname, FILTER_VALIDATE_DOMAIN) === false) {
return false;
}
return true;
}
guest8 09.02.2019 20:52 # −999
Kakou-mo_nemyx 09.02.2019 21:17 # +2
guest8 09.02.2019 21:22 # −999
1024-- 09.02.2019 21:29 # +3
guest8 09.02.2019 22:58 # −999
guest8 09.02.2019 22:33 # −999
bormand 09.02.2019 23:37 # +1
bormand 09.02.2019 23:41 # +1
mkramer 13.02.2019 11:32 # 0
guest8 13.02.2019 12:53 # −999