WordPress.org

Make WordPress Core

Ticket #29688: 29688.3.diff

File 29688.3.diff, 2.9 KB (added by diddledan, 3 years ago)

cleanup patch with proper indents on new code. Fix previous _doing_it_wrong checks were wrong

  • wp-config-sample.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    7979 */
    8080define('WP_DEBUG', false);
    8181
    82 /* That's all, stop editing! Happy blogging. */
     82/*
     83 * That's all, stop editing! Happy blogging.
     84 *
     85 * NOTHING PLACED BELOW THIS LINE WILL HAVE AN EFFECT ON YOUR SITE.
     86 *
     87 */
    8388
    8489/** Absolute path to the WordPress directory. */
    8590if ( !defined('ABSPATH') )
  • wp-load.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    2323
    2424error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
    2525
     26$_wp_config_file = '';
    2627/*
    2728 * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
    2829 * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
     
    3132 *
    3233 * If neither set of conditions is true, initiate loading the setup process.
    3334 */
    34 if ( file_exists( ABSPATH . 'wp-config.php') ) {
     35if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
    3536
    3637        /** The config file resides in ABSPATH */
    37         require_once( ABSPATH . 'wp-config.php' );
     38        $_wp_config_file = ABSPATH . 'wp-config.php';
    3839
    3940} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
    4041
    4142        /** The config file resides one level above ABSPATH but is not part of another install */
    42         require_once( dirname( ABSPATH ) . '/wp-config.php' );
     43        $_wp_config_file = dirname( ABSPATH ) . '/wp-config.php';
     44
     45}
     46
     47if ( '' !== $_wp_config_file ) {
     48
     49        define( 'WP_LOAD_LOADED', true );
     50        require_once( $_wp_config_file );
    4351
    4452} else {
    4553
  • wp-settings.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    102102require( ABSPATH . WPINC . '/pomo/mo.php' );
    103103require( ABSPATH . WPINC . '/class-phpass.php' );
    104104
     105/**
     106 * Prove we're loaded correctly. Executed soon-after functions.php is loaded, which is the earliest we can run _doing_it_wrong().
     107 */
     108if ( ! defined( 'WP_LOAD_LOADED' ) || true !== WP_LOAD_LOADED ) {
     109        _doing_it_wrong( 'wp-settings.php', __( 'Do not load wp-settings.php or wp-config.php directly.' ) ); // @todo: insert WordPress version number
     110}
     111
    105112// Include the wpdb class and, if present, a db.php database drop-in.
    106113global $wpdb;
    107114require_wp_db();