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
This commit is contained in:
parent
5bb7fc10c5
commit
5110f349a9
|
@ -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 = '#^(?:\[)?(?<host>[0-9a-fA-F:]+)(?:\]:(?<port>[\d]+))?#';
|
||||
$pattern = '#^(?:\[)?(?P<host>[0-9a-fA-F:]+)(?:\]:(?P<port>[\d]+))?#';
|
||||
$is_ipv6 = true;
|
||||
} else {
|
||||
// We seem to be dealing with an IPv4 address.
|
||||
$pattern = '#^(?<host>[^:/]*)(?::(?<port>[\d]+))?#';
|
||||
$pattern = '#^(?P<host>[^:/]*)(?::(?P<port>[\d]+))?#';
|
||||
}
|
||||
|
||||
$matches = array();
|
||||
|
|
Loading…
Reference in New Issue