request_uri

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 request_uri()

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

▾ 10 functions call request_uri()

locale in modules/locale/locale.module
Provides interface translation services.
openid_complete in modules/openid/openid.module
Completes OpenID authentication by validating returned data from the OpenID Provider.
page_cache_fastpath in developer-docs/hooks/core.php
Outputs a cached page.
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.admin.inc
Form builder; Configure Clean URL settings.
system_elements in modules/system/system.module
Implementation of hook_elements().
theme_install_page in includes/theme.maintenance.inc
Generate a themed installation page.
watchdog in includes/bootstrap.inc
Log a system message.
_block_get_cache_id in modules/block/block.module
Assemble the cache_id to use for a given block.

Code

includes/bootstrap.inc, line 903

<?php
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;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen