summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {