WordPress.org

Make WordPress Core

Ticket #9166: 9166.patch

File 9166.patch, 761 bytes (added by hakre, 6 years ago)

Such a check function placed in wp-settings.php

  • wp-settings.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    11<?php 
    22/** 
     3 * validate minimum database install to prevent white screens 
     4 */ 
     5function _wp_setup_verify_dbconfig() { 
     6        $consts = array('DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST'); 
     7        foreach($consts as $const) { 
     8                if ( ! defined($const)) { 
     9                        die(sprintf('wp-config is not configured properly, please check the config defines (e.g. "%s")', $const)); 
     10                }                
     11        } 
     12} 
     13_wp_setup_verify_dbconfig(); 
     14 
     15/** 
    316 * Used to setup and fix common variables and include 
    417 * the WordPress procedural and class library. 
    518 *