From 0065f4dbee9ef4a29310a557498e4c7d9f151f3b Mon Sep 17 00:00:00 2001
From: Iain Emsley <iain.emsley@ja.net>
Date: Sat, 1 Dec 2012 16:37:51 +0000
Subject: [PATCH] 1847174 Patch moved to path.admin.inc to display errors

---
 core/modules/path/path.admin.inc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index 4188eff..cc78d7f 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -231,6 +231,15 @@ function path_admin_form_validate($form, &$form_state) {
       ':langcode' => $langcode,
     ))
     ->fetchField();
+  
+  // Ensure that the submitted alias does not begin or end with a forward
+  // slash (/).
+  if (drupal_substr($alias, 0, 1) == '/') {
+  	form_set_error('alias', t('The alias must be a relative path.'));
+  }
+  if (drupal_substr($alias, -1) == '/') {
+  	form_set_error('alias', t('The alias must not have a trailing slash.'));
+  }
 
   if ($has_alias) {
     form_set_error('alias', t('The alias %alias is already in use in this language.', array('%alias' => $alias)));
-- 
1.8.0.1

