From a18a23e8b39c61be40697cf7c9072ede6194572e Mon Sep 17 00:00:00 2001 From: saxmatt Date: Tue, 10 Feb 2004 08:43:23 +0000 Subject: [PATCH] Work around IIS' lack of REQUEST_URI git-svn-id: http://svn.automattic.com/wordpress/trunk@858 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-settings.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-settings.php b/wp-settings.php index a2881e6f3..fdec65042 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -3,6 +3,9 @@ $HTTP_HOST = getenv('HTTP_HOST'); /* domain name */ $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */ $HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */ +// Fix for IIS, which doesn't set REQUEST_URI +$_SERVER['REQUEST_URI'] = ( isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME'] . (( isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : ''))); + // Change to E_ALL for development/debugging error_reporting(E_ALL ^ E_NOTICE); @@ -24,7 +27,7 @@ define('WPINC', 'wp-includes'); require_once (ABSPATH . WPINC . '/wp-db.php'); $wpdb->hide_errors(); -if (!$wpdb->get_row("SELECT * FROM $tableusers LIMIT 1") && !strstr($HTTP_SERVER_VARS['REQUEST_URI'], 'install.php')) { +if (!$wpdb->get_row("SELECT * FROM $tableusers LIMIT 1") && !strstr($_SERVER['REQUEST_URI'], 'install.php')) { die("It doesn't look like you've installed WP yet. Try running install.php."); } $wpdb->show_errors(); @@ -44,7 +47,7 @@ require_once (ABSPATH . WPINC . '/kses.php'); // We should eventually migrate to either calling // get_settings() wherever these are needed OR // accessing a single global $all_settings var -if (!strstr($HTTP_SERVER_VARS['REQUEST_URI'], 'install.php') && !strstr($HTTP_SERVER_VARS['REQUEST_URI'], 'wp-admin/import')) { +if (!strstr($_SERVER['REQUEST_URI'], 'install.php') && !strstr($_SERVER['REQUEST_URI'], 'wp-admin/import')) { $siteurl = get_settings('siteurl'); // "When trying to design a foolproof system, // never underestimate the ingenuity of the fools :)" @@ -115,4 +118,6 @@ if (get_settings('hack_file')) { require(ABSPATH . '/my-hacks.php'); } + + ?> \ No newline at end of file