From b8ef984e94cf8de3571cb3140206b6425eb82f8b Mon Sep 17 00:00:00 2001 From: catch Date: Wed, 8 Aug 2012 22:29:50 +0100 Subject: [PATCH] Issue #1555294 by Pol, tim.plunkett, cristinawithout, gagarine: Fixed Vocabulary title HTML entities are double encoded. --- .../lib/Drupal/taxonomy/Tests/VocabularyTest.php | 11 +++++++++++ core/modules/taxonomy/taxonomy.module | 9 +-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php index d63f176d075..daed3f7d9bd 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php @@ -63,6 +63,17 @@ class VocabularyTest extends TaxonomyTestBase { $edit['machine_name'] = '!&^%'; $this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save')); $this->assertText(t('The machine-readable name must contain only lowercase letters, numbers, and underscores.')); + + // Ensure that vocabulary titles are escaped properly. + $edit = array(); + $edit['name'] = 'Don\'t Panic'; + $edit['description'] = $this->randomName(); + $edit['machine_name'] = 'don_t_panic'; + $this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save')); + + $site_name = config('system.site')->get('name'); + $this->assertTitle(t('Don\'t Panic | @site-name', array('@site-name' => $site_name))); + $this->assertNoTitle(t('Don't Panic | @site-name', array('@site-name' => $site_name))); } /** diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 66c78e14115..6adf1fdbf4e 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -356,7 +356,7 @@ function taxonomy_menu() { ); $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name'] = array( - 'title callback' => 'taxonomy_admin_vocabulary_title_callback', + 'title callback' => 'entity_page_label', 'title arguments' => array(3), 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_overview_terms', 3), @@ -427,13 +427,6 @@ function taxonomy_term_access($op, $term) { return user_access("$op terms in $term->vid") || user_access('administer taxonomy'); } -/** - * Return the vocabulary name given the vocabulary object. - */ -function taxonomy_admin_vocabulary_title_callback(Vocabulary $vocabulary) { - return $vocabulary->name; -} - /** * Saves a vocabulary. *