function request_uri

7.x bootstrap.inc request_uri()
6.x bootstrap.inc request_uri()

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

10 calls to request_uri()
locale in drupal-6.x/modules/locale/locale.module
Provides interface translation services.
openid_complete in drupal-6.x/modules/openid/openid.module
Completes OpenID authentication by validating returned data from the OpenID Provider.
page_cache_fastpath in documentation-6.x/developer/hooks/core.php
Outputs a cached page.
page_get_cache in drupal-6.x/includes/bootstrap.inc
Retrieve the current page from the cache.
page_set_cache in drupal-6.x/includes/common.inc
Store the current page in the cache.

... See full list

4 string references to 'request_uri'
dblog_watchdog in drupal-6.x/modules/dblog/dblog.module
Implementation of hook_watchdog().
hook_watchdog in documentation-6.x/developer/hooks/core.php
Log an event message
theme_syslog_format in drupal-6.x/modules/syslog/syslog.module
Format a system log entry.
watchdog in drupal-6.x/includes/bootstrap.inc
Log a system message.

File

drupal-6.x/includes/bootstrap.inc, line 906
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];
    }
    elseif (isset($_SERVER['QUERY_STRING'])) {
      $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
    }
    else {
      $uri = $_SERVER['SCRIPT_NAME'];
    }
  }
  // Prevent multiple slashes to avoid cross site requests via the FAPI.
  $uri = '/' . ltrim($uri, '/');

  return $uri;
}