diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-06-18 06:59:11 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-06-18 06:59:11 +0000 |
commit | d0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1 (patch) | |
tree | 9b2be29f906f045c48de9ad08a77594a4db32729 /modules/path/path.module | |
parent | 64707c09e9ae2eb6a388c2c3c081c848555cc2b3 (diff) | |
download | brdo-d0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1.tar.gz brdo-d0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1.tar.bz2 |
#150049 by Moshe Weitzman: empower custom url rewriting with url() options
Diffstat (limited to 'modules/path/path.module')
-rw-r--r-- | modules/path/path.module | 9 |
1 files changed, 4 insertions, 5 deletions
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; |