You are here

function request_uri in Drupal 5

Same name and namespace in other branches
  1. 4 includes/bootstrap.inc \request_uri()
  2. 6 includes/bootstrap.inc \request_uri()
  3. 7 includes/bootstrap.inc \request_uri()

Since $_SERVER['REQUEST_URI'] is only available on Apache, we generate an equivalent using other environment variables.

6 calls to request_uri()
locale in modules/locale/locale.module
Provides interface translation services.
page_get_cache in includes/bootstrap.inc
Retrieve the current page from the cache.
page_set_cache in includes/common.inc
Store the current page in the cache.
system_clean_url_settings in modules/system/system.module
system_elements in modules/system/system.module
Implementation of hook_elements().

... See full list

File

includes/bootstrap.inc, line 714
Functions that need to be loaded on every Drupal request.

Code

function request_uri() {
  if (isset($_SERVER['REQUEST_URI'])) {
    $uri = $_SERVER['REQUEST_URI'];
  }
  else {
    if (isset($_SERVER['argv'])) {
      $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
    }
    else {
      $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
    }
  }

  // Prevent multiple slashes to avoid cross site requests via the FAPI.
  $uri = '/' . ltrim($uri, '/');
  return $uri;
}