Work around IIS' lack of REQUEST_URI
git-svn-id: https://develop.svn.wordpress.org/trunk@858 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
26b33fc83d
commit
f468870d93
@ -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 <a href='wp-admin/install.php'>install.php</a>.");
|
||||
}
|
||||
$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');
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user