From dc2900bb1f42df828927f9fc4d8235ca058f0aa5 Mon Sep 17 00:00:00 2001 From: webchick Date: Sat, 18 Aug 2012 13:18:45 +0200 Subject: Issue #1211668 by scito, Devin Carlson, bornholtz: Fixed Special characters are encoded twice for feed icon attribute title. --- modules/simpletest/tests/common.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 437b67cd1..8848b5c26 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -2587,3 +2587,30 @@ class DrupalAddFeedTestCase extends DrupalWebTestCase { return $generated_pattern; } } + +/** + * Test for theme_feed_icon(). + */ +class FeedIconTest extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Feed icon', + 'description' => 'Check escaping of theme_feed_icon()', + 'group' => 'System', + ); + } + + /** + * Check that special characters are correctly escaped. Test for issue #1211668. + */ + function testFeedIconEscaping() { + $variables = array(); + $variables['url'] = 'node'; + $variables['title'] = '<>&"\''; + $text = theme_feed_icon($variables); + preg_match('/title="(.*?)"/', $text, $matches); + $this->assertEqual($matches[1], 'Subscribe to &"'', 'theme_feed_icon() escapes reserved HTML characters.'); + } + +} -- cgit v1.2.3