diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index d45ba59a4fc..a45565ad1c9 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -42,8 +42,13 @@ function path_admin_overview($keys = NULL) { $destination = drupal_get_destination(); foreach ($result as $data) { $row = array(); - $row['data']['alias'] = l($data->alias, $data->source); - $row['data']['source'] = l($data->source, $data->source, array('alias' => TRUE)); + $row['data']['alias'] = l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array( + 'attributes' => array('title' => $data->alias), + )); + $row['data']['source'] = l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array( + 'alias' => TRUE, + 'attributes' => array('title' => $data->source), + )); if ($multilanguage) { $row['data']['language_name'] = language_name($data->langcode); } diff --git a/core/modules/path/path.test b/core/modules/path/path.test index 0066071d0f4..7150e617f53 100644 --- a/core/modules/path/path.test +++ b/core/modules/path/path.test @@ -128,6 +128,18 @@ class PathAliasTestCase extends PathTestCase { $this->drupalGet($edit['alias']); $this->assertNoText($node1->title, 'Alias was successfully deleted.'); $this->assertResponse(404); + + // Create a really long alias. + $edit = array(); + $edit['source'] = 'node/' . $node1->nid; + $alias = $this->randomName(128); + $edit['alias'] = $alias; + // The alias is shortened to 50 characters counting the elipsis. + $truncated_alias = substr($alias, 0, 47); + $this->drupalPost('admin/config/search/path/add', $edit, t('Save')); + $this->assertNoText($alias, 'The untruncated alias was not found.'); + // The 'truncated' alias will always be found. + $this->assertText($truncated_alias, 'The truncated alias was found.'); } /**