From 906bc342269efc1f2dd236956c8e000c037b0329 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 23 Jan 2018 03:40:42 +0000 Subject: [PATCH] WPDB: Use a PCRE syntax which supports PCRE compiled between 2003 and 2006. This fixes a PHP Warning in `wpdb::parse_db_host()` when WordPress is used with (sometimes a modern) PHP that's compiled against an ancient PCRE version. Merges [42549] to the 4.9 branch. Fixes #43109 for 4.9. Built from https://develop.svn.wordpress.org/branches/4.9@42550 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42379 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/wp-db.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index b0ccfcdf5b..1ce5e226e1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.3-alpha-42548'; +$wp_version = '4.9.3-alpha-42550'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index fefbe8a284..72702fcb1c 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1646,11 +1646,11 @@ class wpdb { // 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 = '#^(?:\[)?(?[0-9a-fA-F:]+)(?:\]:(?[\d]+))?#'; + $pattern = '#^(?:\[)?(?P[0-9a-fA-F:]+)(?:\]:(?P[\d]+))?#'; $is_ipv6 = true; } else { // We seem to be dealing with an IPv4 address. - $pattern = '#^(?[^:/]*)(?::(?[\d]+))?#'; + $pattern = '#^(?P[^:/]*)(?::(?P[\d]+))?#'; } $matches = array();