? trim-alias.patch
Index: modules/path/path.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.admin.inc,v
retrieving revision 1.26
diff -u -p -r1.26 path.admin.inc
--- modules/path/path.admin.inc	8 Jul 2009 07:26:31 -0000	1.26
+++ modules/path/path.admin.inc	8 Jul 2009 15:19:17 -0000
@@ -112,7 +112,7 @@ function path_admin_form(&$form_state, $
     '#default_value' => $edit['dst'],
     '#maxlength' => 255,
     '#size' => 45,
-    '#description' => t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
+    '#description' => t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path.'),
     '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
     '#required' => TRUE,
   );
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.163
diff -u -p -r1.163 path.module
--- modules/path/path.module	8 Jul 2009 07:46:10 -0000	1.163
+++ modules/path/path.module	8 Jul 2009 15:19:17 -0000
@@ -82,7 +82,8 @@ function path_admin_delete($pid = 0) {
  */
 function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '') {
   $path = urldecode($path);
-  $alias = urldecode($alias);
+  // Remove any dots from the alias.
+  $alias = urldecode(str_replace('.','',$alias));
+  // Remove possible slashes from both ends to avoid invalid aliases.
+  $alias = urldecode(trim($alias, '/'));
   // First we check if we deal with an existing alias and delete or modify it based on pid.
   if ($pid) {
     // An existing alias.
@@ -234,7 +235,7 @@ function path_form_alter(&$form, $form_s
       '#maxlength' => 255,
       '#collapsible' => TRUE,
       '#collapsed' => TRUE,
-      '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
+      '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path.'),
     );
     if ($path) {
       $form['path']['pid'] = array(
