Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/api.drupal.org/htdocs/sites/all/modules/api/api.module on line 1058

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /var/www/api.drupal.org/htdocs/sites/all/modules/api/api.module on line 1058
conf_url_rewrite | Drupal API

conf_url_rewrite

Versions
4.6
conf_url_rewrite($path, $mode = 'incoming')

▾ 2 functions call conf_url_rewrite()

drupal_get_normal_path in includes/common.inc
Given a path alias, return the internal path it represents.
drupal_get_path_alias in includes/bootstrap.inc
Given an internal Drupal path, return the alias set by the administrator.

Code

modules/path.module, line 49

<?php
function conf_url_rewrite($path, $mode = 'incoming') {
  if ($mode == 'incoming') { // URL coming from a client
    return preg_replace('!^display/(\\d+)\$!', 'node/\\1', $path);
  }
  else { // URL going out to a client
    $aliased = preg_replace('!^node/(\\d+)\$!', 'display/\\1', $path);
    if ($aliased != $path) { return $aliased; }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.