Work around IIS' lack of REQUEST_URI

git-svn-id: http://svn.automattic.com/wordpress/trunk@858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-02-10 08:43:23 +00:00
parent e2ddf1efe1
commit a18a23e8b3
1 changed files with 7 additions and 2 deletions

View File

@ -3,6 +3,9 @@ $HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */ $REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */ $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 // Change to E_ALL for development/debugging
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
@ -24,7 +27,7 @@ define('WPINC', 'wp-includes');
require_once (ABSPATH . WPINC . '/wp-db.php'); require_once (ABSPATH . WPINC . '/wp-db.php');
$wpdb->hide_errors(); $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 <a href='wp-admin/install.php'>install.php</a>."); die("It doesn't look like you've installed WP yet. Try running <a href='wp-admin/install.php'>install.php</a>.");
} }
$wpdb->show_errors(); $wpdb->show_errors();
@ -44,7 +47,7 @@ require_once (ABSPATH . WPINC . '/kses.php');
// We should eventually migrate to either calling // We should eventually migrate to either calling
// get_settings() wherever these are needed OR // get_settings() wherever these are needed OR
// accessing a single global $all_settings var // 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'); $siteurl = get_settings('siteurl');
// "When trying to design a foolproof system, // "When trying to design a foolproof system,
// never underestimate the ingenuity of the fools :)" // never underestimate the ingenuity of the fools :)"
@ -115,4 +118,6 @@ if (get_settings('hack_file')) {
require(ABSPATH . '/my-hacks.php'); require(ABSPATH . '/my-hacks.php');
} }
?> ?>