summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-01-05 18:23:21 +0000
committerDries Buytaert <dries@buytaert.net>2004-01-05 18:23:21 +0000
commitdaaeef0e8c39ebd28a865526702870b1e7733804 (patch)
treea055d1eb7c2ad8850e9b74e8ea1b9eb7ed84f9e9 /includes/common.inc
parent3176e66905f2c6da3361b6a8cf1a5a0af7f2aada (diff)
downloadbrdo-daaeef0e8c39ebd28a865526702870b1e7733804.tar.gz
brdo-daaeef0e8c39ebd28a865526702870b1e7733804.tar.bz2
- Partial patch #4927: mass URL aliasing by Goba.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc24
1 files changed, 17 insertions, 7 deletions
diff --git a/includes/common.inc b/includes/common.inc
index b631288b9..2de172c89 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -801,10 +801,14 @@ function form_allowed_tags_text() {
* Given an old url, return the alias.
*/
function drupal_get_path_alias($path) {
- $map = drupal_get_path_map();
-
- if ($map) {
- return array_search($path, $map);
+ if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) {
+ return $newpath;
+ }
+ elseif (function_exists("conf_url_rewrite")) {
+ return conf_url_rewrite($path, 'outgoing');
+ }
+ else {
+ return $path;
}
}
@@ -812,9 +816,15 @@ function drupal_get_path_alias($path) {
* Given an alias, return the default url.
*/
function drupal_get_normal_path($path) {
- $map = drupal_get_path_map();
-
- return $map[$path] ? $map[$path] : $path;
+ if (($map = drupal_get_path_map()) && isset($map[$path])) {
+ return $map[$path];
+ }
+ elseif (function_exists("conf_url_rewrite")) {
+ return conf_url_rewrite($path, 'incoming');
+ }
+ else {
+ return $path;
+ }
}
function url($url = NULL, $query = NULL, $fragment = NULL) {