diff --git a/wp-settings.php b/wp-settings.php index a2881e6f31..fdec650426 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