Commit df07e0d2 authored by Dries's avatar Dries
Browse files

- Patch #1211668 by scito, Devin Carlson, bornholtz: special characters are...

- Patch #1211668 by scito, Devin Carlson, bornholtz: special characters are encoded twice for feed icon attribute title.
parent 49b0490b
......@@ -2103,7 +2103,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('uri' => 'core/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)));
}
......
......@@ -89,4 +89,16 @@ function urlToRSSLinkPattern($url, $title = '') {
$generated_pattern = '%<link +rel="alternate" +type="application/rss.xml" +title="' . $title . '" +href="' . $url . '" */>%';
return $generated_pattern;
}
/**
* 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.');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment