From 5b8113578d44a36065d43e37c49190264a842cbb Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 21 May 2008 05:59:27 +0000 Subject: [PATCH] Allow wp-config.php to exist one level up from WordPress root directory. Props sambauers. fixes #6933 git-svn-id: http://svn.automattic.com/wordpress/trunk@7971 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 2 +- wp-admin/admin.php | 4 +-- wp-admin/async-upload.php | 4 +-- wp-admin/install-helper.php | 3 +- wp-admin/install.php | 7 +---- wp-admin/link-parse-opml.php | 2 +- wp-admin/moderation.php | 2 +- wp-admin/setup-config.php | 4 +++ wp-admin/update-links.php | 2 +- wp-admin/upgrade.php | 4 +-- wp-app.php | 2 +- wp-atom.php | 2 +- wp-blog-header.php | 21 ++++---------- wp-comments-post.php | 2 +- wp-commentsrss2.php | 2 +- wp-config-sample.php | 5 ++-- wp-cron.php | 2 +- wp-includes/js/tinymce/tiny_mce_config.php | 4 +-- wp-includes/js/tinymce/wp-mce-help.php | 2 +- wp-links-opml.php | 2 +- wp-load.php | 32 ++++++++++++++++++++++ wp-login.php | 2 +- wp-mail.php | 2 +- wp-pass.php | 2 +- wp-rdf.php | 2 +- wp-register.php | 2 +- wp-rss.php | 2 +- wp-rss2.php | 2 +- wp-trackback.php | 2 +- xmlrpc.php | 2 +- 30 files changed, 75 insertions(+), 53 deletions(-) create mode 100644 wp-load.php diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 1fe24f769559..ddb3f306c75e 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -1,7 +1,7 @@ wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

Create a Configuration File", "WordPress › Error"); -} -require_once('../wp-config.php'); +require_once('../wp-load.php'); require_once('./includes/upgrade.php'); if (isset($_GET['step'])) diff --git a/wp-admin/link-parse-opml.php b/wp-admin/link-parse-opml.php index 0e5edf0d3199..1cd27d0aa3fd 100644 --- a/wp-admin/link-parse-opml.php +++ b/wp-admin/link-parse-opml.php @@ -1,5 +1,5 @@ diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 39220046d663..78f52fa96a18 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -20,6 +20,10 @@ if (file_exists('../wp-config.php')) wp_die("

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.

"); +// Check if wp-config.php exists above the root directory +if (file_exists('../../wp-config.php')) + wp_die("

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.

"); + if (isset($_GET['step'])) $step = $_GET['step']; else diff --git a/wp-admin/update-links.php b/wp-admin/update-links.php index 0f5ef46c0699..5fd02e062b7c 100644 --- a/wp-admin/update-links.php +++ b/wp-admin/update-links.php @@ -1,5 +1,5 @@ wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

Create a Configuration File"); -require('../wp-config.php'); +require('../wp-load.php'); timer_start(); require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); diff --git a/wp-app.php b/wp-app.php index 52ce7b73ecc5..5ea5f1d888ac 100644 --- a/wp-app.php +++ b/wp-app.php @@ -9,7 +9,7 @@ define('APP_REQUEST', true); -require_once('./wp-config.php'); +require_once('./wp-load.php'); require_once(ABSPATH . WPINC . '/post-template.php'); require_once(ABSPATH . WPINC . '/atomlib.php'); require_once(ABSPATH . WPINC . '/feed.php'); diff --git a/wp-atom.php b/wp-atom.php index 4c52b97f01ff..179ffa270781 100644 --- a/wp-atom.php +++ b/wp-atom.php @@ -1,7 +1,7 @@ wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

Create a Configuration File", "WordPress › Error"); -} - -$wp_did_header = true; + $wp_did_header = true; -require_once( dirname(__FILE__) . '/wp-config.php'); + require_once( dirname(__FILE__) . '/wp-load.php' ); -wp(); + wp(); -require_once(ABSPATH . WPINC . '/template-loader.php'); + require_once( ABSPATH . WPINC . '/template-loader.php' ); -endif; +} ?> diff --git a/wp-comments-post.php b/wp-comments-post.php index bd04e736c1ec..aa6184b66a94 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -5,7 +5,7 @@ header('Content-Type: text/plain'); exit; } -require( dirname(__FILE__) . '/wp-config.php' ); +require( dirname(__FILE__) . '/wp-load.php' ); nocache_headers(); diff --git a/wp-commentsrss2.php b/wp-commentsrss2.php index 5c3f169f6aa7..50e241f0dac6 100644 --- a/wp-commentsrss2.php +++ b/wp-commentsrss2.php @@ -1,7 +1,7 @@ diff --git a/wp-cron.php b/wp-cron.php index f60ac56e4682..fcf12c8bf981 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -1,7 +1,7 @@ diff --git a/wp-links-opml.php b/wp-links-opml.php index dfa3a44e1207..3eae2b02a8ec 100644 --- a/wp-links-opml.php +++ b/wp-links-opml.php @@ -1,7 +1,7 @@ wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

Create a Configuration File", "WordPress › Error"); + +} + +?> diff --git a/wp-login.php b/wp-login.php index b3d1f0bfb186..d276cba1aa38 100644 --- a/wp-login.php +++ b/wp-login.php @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/wp-rss.php b/wp-rss.php index 6f08ee8dc6e3..c0671ea2b96a 100644 --- a/wp-rss.php +++ b/wp-rss.php @@ -1,7 +1,7 @@