Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.28 diff -u -F^f -r1.28 bootstrap.inc --- includes/bootstrap.inc 16 Sep 2004 07:17:54 -0000 1.28 +++ includes/bootstrap.inc 18 Sep 2004 00:52:12 -0000 @@ -190,7 +190,7 @@ function page_set_cache() { $data = gzencode($data, FORCE_GZIP); } } - cache_set($base_url . request_uri(), $data, CACHE_TEMPORARY, drupal_get_headers()); + cache_set($base_url .'/'. request_uri(), $data, CACHE_TEMPORARY, drupal_get_headers()); } } } @@ -209,7 +209,7 @@ function page_get_cache() { $cache = NULL; if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET' && count(drupal_set_message()) == 0) { - $cache = cache_get($base_url . request_uri()); + $cache = cache_get($base_url .'/'. request_uri()); if (empty($cache)) { ob_start(); @@ -362,16 +363,19 @@ function check_url($uri) { } /** - * Since request_uri() is only available on Apache, we generate an - * equivalent using other environment vars. + * This is a replacement for REQUEST_URI which returns the part of the path relative to $base_url. + * Does not start with a slash. */ function request_uri() { + global $base_url; + + $parsed = parse_url($base_url); - if (isset($_SERVER['REQUEST_URI'])) { - $uri = $_SERVER['REQUEST_URI']; + if (isset($parsed['path'])) { + $uri = str_replace($parsed['path'] .'/', '', $_SERVER['PHP_SELF']) .'?'. $_SERVER['argv'][0]; } else { - $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0]; + $uri = substr($_SERVER['PHP_SELF'], 1) .'?'. $_SERVER['argv'][0]; } return check_url($uri); Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.390 diff -u -F^f -r1.390 common.inc --- includes/common.inc 16 Sep 2004 16:12:21 -0000 1.390 +++ includes/common.inc 18 Sep 2004 00:52:12 -0000 @@ -1078,8 +1078,10 @@ function format_name($object) { * An HTML string with the contents of $form wrapped in a form tag. */ function form($form, $method = 'post', $action = NULL, $attributes = NULL) { + global $base_url; + if (!$action) { - $action = request_uri(); + $action = $base_url . request_uri(); } return '
\n". $form ."\n
\n"; }