From 719f51b19d24551824a7ee50f878fbbb95c4ae2d Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 6 Oct 2015 14:19:17 +0000 Subject: [PATCH] Setup/Config: some `dirname( ABSPATH )` file lookups should have errors suppressed due to possibility of `open_basedir` restrictions on hosts. Props chriscct7, misterunknown. Fixes #29680. git-svn-id: https://develop.svn.wordpress.org/trunk@34867 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/setup-config.php | 3 ++- src/wp-load.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php index 1c464727c6..c24dfbee89 100644 --- a/src/wp-admin/setup-config.php +++ b/src/wp-admin/setup-config.php @@ -53,8 +53,9 @@ if ( file_exists( ABSPATH . 'wp-config.php' ) ) wp_die( '

' . sprintf( __( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now." ), 'install.php' ) . '

' ); // Check if wp-config.php exists above the root directory but is not part of another install -if ( file_exists(ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '../wp-settings.php' ) ) +if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) { wp_die( '

' . sprintf( __( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now."), 'install.php' ) . '

' ); +} $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; diff --git a/src/wp-load.php b/src/wp-load.php index 983298bb68..a20fc0ac57 100644 --- a/src/wp-load.php +++ b/src/wp-load.php @@ -36,10 +36,10 @@ if ( file_exists( ABSPATH . 'wp-config.php') ) { /** The config file resides in ABSPATH */ require_once( ABSPATH . 'wp-config.php' ); -} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && ! file_exists( dirname(ABSPATH) . '/wp-settings.php' ) ) { +} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) { /** The config file resides one level above ABSPATH but is not part of another install */ - require_once( dirname(ABSPATH) . '/wp-config.php' ); + require_once( dirname( ABSPATH ) . '/wp-config.php' ); } else {