mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
mvc: add isLinkLocal() for #6775
This commit is contained in:
parent
79355e3641
commit
e29a4e009d
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017-2022 Deciso B.V.
|
||||
* Copyright (C) 2017-2023 Deciso B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -62,6 +62,16 @@ class Util
|
||||
return !empty(filter_var($address, FILTER_VALIDATE_IP));
|
||||
}
|
||||
|
||||
/**
|
||||
* is provided address an link-locak IPv6 address.
|
||||
* @param string $address network address
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isLinkLocal($address)
|
||||
{
|
||||
return !!preg_match('/^fe[89ab][0-9a-f]:/i', $address);
|
||||
}
|
||||
|
||||
/**
|
||||
* is provided address a mac address.
|
||||
* @param string $address network address
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user