RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.354
diff -u -p -r1.354 bootstrap.inc
--- includes/bootstrap.inc	21 Feb 2010 18:10:31 -0000	1.354
+++ includes/bootstrap.inc	23 Feb 2010 13:33:05 -0000
@@ -2162,6 +2162,8 @@
  *   base_path() returns "/drupalfolder/".
  * - http://example.com/path/alias (which is a path alias for node/306) returns
  *   "path/alias" as opposed to the internal path.
+ * - http://example.com/index.php returns an empty string (meaning: front page)
+ * - http://example.com/index.php?page=1 returns an empty string
  *
  * @return
  *   The requested Drupal URL path.
@@ -2183,11 +2185,16 @@
     $path = $_GET['q'];
   }
   elseif (isset($_SERVER['REQUEST_URI'])) {
-    // This is a request using a clean URL. Extract the path from REQUEST_URI.
+    // This request may be using a clean URL. Extract the path from REQUEST_URI.
     $request_path = strtok($_SERVER['REQUEST_URI'], '?');
     $base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/'));
     // Unescape and strip $base_path prefix, leaving q without a leading slash.
     $path = substr(urldecode($request_path), $base_path_len + 1);
+    // If the path starts with index.php and $GET['q'] is not set,
+    // the front page is served.
+    if (strpos($path, 'index.php') === 0) {
+      $path = '';
+    }
   }
   else {
     // This is the front page.

