diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-12-12 19:44:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-12-12 19:44:57 +0000 |
commit | f153bcb9bb964e8484857ef76b9a587a652f4717 (patch) | |
tree | b5ed220b1f253f750b0c3ccc27d3dbf6c5f5523e | |
parent | ee92242333ebdd30809b725226e77a01c5b043b0 (diff) | |
download | brdo-f153bcb9bb964e8484857ef76b9a587a652f4717.tar.gz brdo-f153bcb9bb964e8484857ef76b9a587a652f4717.tar.bz2 |
- Simplified the way the 'real path' is resolved.
-rw-r--r-- | includes/common.inc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/includes/common.inc b/includes/common.inc index 351e0e07e..cc412fce0 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -815,7 +815,13 @@ function drupal_get_path_alias($path) { */ function drupal_get_normal_path($path) { $map = drupal_get_path_map(); - return $map[$path]; + + if ($map[$path]) { + return $map[$path]; + } + else { + return $path; + } } function url($url = NULL, $query = NULL) { @@ -945,17 +951,10 @@ header("Content-Type: text/html; charset=utf-8"); // initialize the _GET["q"] prior to loading the modules and invoking their 'init' hook: if (!empty($_GET["q"])) { - if ($path = drupal_get_normal_path(trim($_GET["q"], "/"))) { - $_GET["q"] = $path; - } + $_GET["q"] = drupal_get_normal_path(trim($_GET["q"], "/")); } else { - if ($path = drupal_get_normal_path(variable_get("site_frontpage", "node"))) { - $_GET["q"] = $path; - } - else { - $_GET["q"] = variable_get("site_frontpage", "node"); - } + $_GET["q"] = drupal_get_normal_path(variable_get("site_frontpage", "node")); } // initialize installed modules: |