Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3921771
D1609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D1609.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 23:00 (20 h, 15 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2309956
Default Alt Text
D1609.diff (1 KB)
Attached To
Mode
D1609: Switch is_ip, is_ipv4 and is_ipv6 to Keruald\OmniTools\Network\IP
Attached
Detach File
Event Timeline
Log In to Comment