summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/theme.inc2
-rw-r--r--modules/simpletest/tests/common.test27
2 files changed, 28 insertions, 1 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index c4b712271..79750afe4 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -2128,7 +2128,7 @@ function theme_more_help_link($variables) {
* - title: A descriptive title of the feed.
*/
function theme_feed_icon($variables) {
- $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title']));
+ $text = t('Subscribe to !feed-title', array('!feed-title' => $variables['title']));
if ($image = theme('image', array('path' => 'misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) {
return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text)));
}
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 &amp;&quot;&#039;', 'theme_feed_icon() escapes reserved HTML characters.');
+ }
+
+}