Make WordPress Core

Changeset 42550 for branches/4.9


Ignore:
Timestamp:
01/23/2018 03:39:45 AM (7 years ago)
Author:
dd32
Message:

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.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/wp-db.php

    r42455 r42550  
    16471647        // An IPv6 address will always contain at least two colons.
    16481648        if ( substr_count( $host, ':' ) > 1 ) {
    1649             $pattern = '#^(?:\[)?(?<host>[0-9a-fA-F:]+)(?:\]:(?<port>[\d]+))?#';
     1649            $pattern = '#^(?:\[)?(?P<host>[0-9a-fA-F:]+)(?:\]:(?P<port>[\d]+))?#';
    16501650            $is_ipv6 = true;
    16511651        } else {
    16521652            // We seem to be dealing with an IPv4 address.
    1653             $pattern = '#^(?<host>[^:/]*)(?::(?<port>[\d]+))?#';
     1653            $pattern = '#^(?P<host>[^:/]*)(?::(?P<port>[\d]+))?#';
    16541654        }
    16551655
Note: See TracChangeset for help on using the changeset viewer.