diff --git a/lib/PostEditorBlocks/PostEditorBlock.php b/lib/PostEditorBlocks/PostEditorBlock.php index a7336bda81..df2ff3cfb1 100644 --- a/lib/PostEditorBlocks/PostEditorBlock.php +++ b/lib/PostEditorBlocks/PostEditorBlock.php @@ -27,8 +27,6 @@ class PostEditorBlock { } public function init() { - // this has to be here until we drop support for WordPress < 5.0 - if (!function_exists('register_block_type')) return; $this->subscriptionFormBlock->init(); if (is_admin()) { diff --git a/lib/WP/Functions.php b/lib/WP/Functions.php index 6df073d02f..97b6b66371 100644 --- a/lib/WP/Functions.php +++ b/lib/WP/Functions.php @@ -684,45 +684,6 @@ class Functions { */ public function parseDbHost($host) { global $wpdb; - if (method_exists($wpdb, 'parse_db_host')) { - return $wpdb->parse_db_host($host); - } else { - // Backward compatibility for WP 4.7 and 4.8 - $port = null; - $socket = null; - $isIpv6 = false; - - // First peel off the socket parameter from the right, if it exists. - $socketPos = strpos( $host, ':/' ); - if ($socketPos !== false) { - $socket = substr($host, $socketPos + 1); - $host = substr($host, 0, $socketPos); - } - - // We need to check for an IPv6 address first. - // An IPv6 address will always contain at least two colons. - if (substr_count( $host, ':' ) > 1) { - $pattern = '#^(?:\[)?(?P[0-9a-fA-F:]+)(?:\]:(?P[\d]+))?#'; - $isIpv6 = true; - } else { - // We seem to be dealing with an IPv4 address. - $pattern = '#^(?P[^:/]*)(?::(?P[\d]+))?#'; - } - - $matches = []; - $result = preg_match($pattern, $host, $matches); - if (1 !== $result) { - // Couldn't parse the address, bail. - return false; - } - - $host = ''; - foreach (['host', 'port'] as $component) { - if (!empty($matches[$component])) { - $$component = $matches[$component]; - } - } - return [$host, $port, $socket, $isIpv6]; - } + return $wpdb->parse_db_host($host); } }