string $maybe_ip A suspected IP address.
* @return int|false Upon success, '4' or '6' to represent an IPv4 or IPv6 address, false upon failure.
*/
public static function is_ip_address( $maybe_ip ) {
if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) {
return 4;
}
if ( str_contains( $maybe_ip, ':' ) && preg_match( '/^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i', trim( $maybe_ip, ' []' ) ) ) {
return 6;
}
return false;
}
}
Fatal error: Uncaught Error: Class 'WpOrg\Requests\Hooks' not found in /home/ocb/public_html/wp-includes/class-wp-http-requests-hooks.php:18
Stack trace:
#0 /home/ocb/public_html/wp-settings.php(276): require()
#1 /home/ocb/public_html/wp-config.php(77): require_once('/home/ocb/publi...')
#2 /home/ocb/public_html/wp-load.php(50): require_once('/home/ocb/publi...')
#3 /home/ocb/public_html/wp-blog-header.php(13): require_once('/home/ocb/publi...')
#4 /home/ocb/public_html/index.php(17): require('/home/ocb/publi...')
#5 {main}
thrown in /home/ocb/public_html/wp-includes/class-wp-http-requests-hooks.php on line 18
Fatal error: Uncaught Error: Call to a member function set() on null in /home/ocb/public_html/wp-includes/l10n.php:856
Stack trace:
#0 /home/ocb/public_html/wp-includes/l10n.php(959): load_textdomain('default', '/home/ocb/publi...', 'lv')
#1 /home/ocb/public_html/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /home/ocb/public_html/wp-includes/l10n.php on line 856