Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: preg_match(): Compilation failed at wp-db.php on line 1657

Discussion in 'Misc WordPress Requests' started by crkm, Nov 19, 2017.

  1. crkm

    Guest

    Reply To: preg_match(): Compilation failed at wp-db.php on line 1657, by crkm

    @swansonphotos The complete error message I’m getting on a desktop browser for http://www.curtc.net is
    Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/userxxxxx/website/wp/wp-includes/wp-db.php on line 1657

    Warning: Cannot modify header information – headers already sent by (output started at /web1/userxxxxx/website/wp/wp-includes/wp-db.php:1657) in /web1/userxxxxxx/website/wp/wp-content/plugins/sign-up-sheets-pro/lib/dls-session.php on line 105
    xxxxx=user number

    The second part varies in a way I don’t understand. For example on loading the login page I get

    Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/userxxxxxx/website/wp/wp-includes/wp-db.php on line 1657

    Warning: Cannot modify header information – headers already sent by (output started at /web1/userxxxxx/website/wp/wp-includes/wp-db.php:1657) in /web1/userxxxxxx/website/wp/wp-includes/pluggable.php on line 1216

    The
    Warning: preg_match(): Compilation failed: unrecognized character after (?< at offset 4 in /web1/userxxxxxx/website/wp/wp-includes/wp-db.php on line 1657
    appears common to all these error messages.

    The relevant code in wp-db.php is (ending in line 1657)
    * @since 4.9.0
    *
    * @param string $host The DB_HOST setting to parse.
    * @return array|bool Array containing the host, the port, the socket and whether
    * it is an IPv6 address, in that order. If $host couldn’t be parsed,
    * returns false.
    */
    public function parse_db_host( $host ) {
    $port = null;
    $socket = null;
    $is_ipv6 = false;

    // 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]+))?(?:/(?<socket>.+))?#’;
    $is_ipv6 = true;
    } else {
    // We seem to be dealing with an IPv4 address.
    $pattern = ‘#^(?<host>[^:/]*)(?::(?<port>[\d]+))?(?::(?<socket>.+))?#’;
    }

    $matches = array();
    $result = preg_match( $pattern, $host, $matches );

    Reply To: preg_match(): Compilation failed at wp-db.php on line 1657
     
    #1

Share This Page

Web Hosting