From 5110f349a908e21806f1dc304778ae230f500aab Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 23 Jan 2018 03:38: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. Fixes #43109 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@42549 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/wp-db.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 674800a8a9..1e5fda6743 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1703,11 +1703,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();