### Eclipse Workspace Patch 1.0 #P lep2-quotify Index: drupal/includes/bootstrap.inc =================================================================== --- drupal/includes/bootstrap.inc (revision 5) +++ drupal/includes/bootstrap.inc (working copy) @@ -198,11 +198,16 @@ if ($conf) { return $conf; } - $confdir = 'sites'; - $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']); + // $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']); + // Patch to use REQUEST_URI to determine site names rather than SCRIPT_NAME + if(strpos($_SERVER['REQUEST_URI'],'?')) + $raw_uri = substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'?')); // Cut out all after the '?' + else + $raw_uri = $_SERVER['REQUEST_URI']; + $uri = explode('/', $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']); $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))))); - for ($i = count($uri) - 1; $i > 0; $i--) { + for ($i = count($uri); $i > 0; $i--) { for ($j = count($server); $j > 0; $j--) { $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); if (file_exists("$confdir/$dir/settings.php")) {