Index: includes/path.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/path.inc,v retrieving revision 1.60 diff -u -p -r1.60 path.inc --- includes/path.inc 10 Mar 2010 19:36:14 -0000 1.60 +++ includes/path.inc 21 Apr 2010 07:10:53 -0000 @@ -469,11 +469,14 @@ function path_load($conditions) { function path_save(&$path) { $path += array('pid' => NULL, 'language' => LANGUAGE_NONE); + // Allow modules to alter the alias before saving. + drupal_alter('path', $path); + // Insert or update the alias. $status = drupal_write_record('url_alias', $path, (!empty($path['pid']) ? 'pid' : NULL)); // Verify that a record was written. - if (isset($status) && $status) { + if (!empty($status)) { if ($status === SAVED_NEW) { module_invoke_all('path_insert', $path); } Index: modules/path/path.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.api.php,v retrieving revision 1.1 diff -u -p -r1.1 path.api.php --- modules/path/path.api.php 17 Oct 2009 00:52:36 -0000 1.1 +++ modules/path/path.api.php 21 Apr 2010 07:10:53 -0000 @@ -11,6 +11,14 @@ * @{ */ +/** + * Perform alterations to an URL alias before it is saved. + * + * @param $path + * The path array. + */ +function hook_path_alter(&$path) { +} /** * The path has been inserted.