Page MenuHomeDevCentral

D1609.id4111.diff
No OneTemporary

D1609.id4111.diff

diff --git a/core.php b/core.php
--- a/core.php
+++ b/core.php
@@ -2,6 +2,7 @@
namespace Keruald;
+use Keruald\OmniTools\Network\IP;
use Keruald\OmniTools\Strings\Multibyte\StringUtilities;
/**
@@ -35,9 +36,10 @@
*
* @param string $string the string to validate as an IP
* @return bool true if the specified string is a valid IP address; otherwise, false
+ * @deprecated Use Keruald\OmniTools\Network\IP::isIP
*/
function is_ip ($string) {
- return is_ipv4($string) || is_ipv6($string);
+ return IP::isIP($string);
}
/**
@@ -45,9 +47,10 @@
*
* @param string $string the string to validate as an IP
* @return bool true if the specified string is a valid IPv4 address; otherwise, false
+ * @deprecated Use Keruald\OmniTools\Network\IP::isIPv4
*/
function is_ipv4 ($string) {
- return filter_var($string, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
+ return IP::isIPv4($string);
}
/**
@@ -55,9 +58,10 @@
*
* @param string $string the string to validate as an IP
* @return bool true if the specified string is a valid IPv6 address; otherwise, false
+ * @deprecated Use Keruald\OmniTools\Network\IP::isIPv6
*/
function is_ipv6 ($string) {
- return filter_var($string, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;
+ return IP::isIPv6($string);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 08:15 (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2307417
Default Alt Text
D1609.id4111.diff (1 KB)

Event Timeline