From d0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 18 Jun 2007 06:59:11 +0000 Subject: #150049 by Moshe Weitzman: empower custom url rewriting with url() options --- modules/path/path.module | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/path/path.module') diff --git a/modules/path/path.module b/modules/path/path.module index bb1820662..b932a1b66 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -233,11 +233,10 @@ function path_nodeapi(&$node, $op, $arg) { case 'load': $path = "node/$node->nid"; - // We don't use drupal_get_path_alias() to avoid custom rewrite functions. - // We only care about exact aliases. - $result = db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path); - if (db_num_rows($result)) { - $node->path = db_result($result); + $language = isset($node->language) ? $node->language : ''; + $alias = drupal_get_path_alias($path, $language); + if ($path != $alias) { + $node->path = $alias; } break; -- cgit v1.2.3