WordPress.org

WordPress build repository browser

Changeset 42529


Ignore:
Timestamp:
02/11/18 18:47:30 (11 days ago)
Author:
SergeyBiryukov
Message:

Database: In require_wp_db(), check if database constants are defined before using them.

Otherwise, wp-admin/setup-config.php triggers an undefined constant warning in PHP 7.2.

Props mariusvw, jryancard for initial patch.
Fixes #35560.
Built from https://develop.svn.wordpress.org/trunk@42701

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/load.php

    r42172 r42529  
    419419    } 
    420420 
    421     $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST ); 
     421    $dbuser     = defined( 'DB_USER' ) ? DB_USER : ''; 
     422    $dbpassword = defined( 'DB_PASSWORD' ) ? DB_PASSWORD : ''; 
     423    $dbname     = defined( 'DB_NAME' ) ? DB_NAME : ''; 
     424    $dbhost     = defined( 'DB_HOST' ) ? DB_HOST : ''; 
     425 
     426    $wpdb = new wpdb( $dbuser, $dbpassword, $dbname, $dbhost ); 
    422427} 
    423428 
  • trunk/wp-includes/version.php

    r42528 r42529  
    55 * @global string $wp_version 
    66 */ 
    7 $wp_version = '5.0-alpha-42700'; 
     7$wp_version = '5.0-alpha-42701'; 
    88 
    99/** 
Note: See TracChangeset for help on using the changeset viewer.