mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Run htmlspecialchars on title attribute text in get_archives_link(). Bug 0000162.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
911e73fdff
commit
44f4b916f8
@ -194,14 +194,16 @@ function single_month_title($prefix = '', $display = true ) {
|
|||||||
/* link navigation hack by Orien http://icecode.com/ */
|
/* link navigation hack by Orien http://icecode.com/ */
|
||||||
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
|
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
|
||||||
$text = wptexturize($text);
|
$text = wptexturize($text);
|
||||||
|
$title_text = htmlspecialchars($text);
|
||||||
|
|
||||||
if ('link' == $format) {
|
if ('link' == $format) {
|
||||||
return "\t<link rel='archives' title='$text' href='$url' />\n";
|
return "\t<link rel='archives' title='$title_text' href='$url' />\n";
|
||||||
} elseif ('option' == $format) {
|
} elseif ('option' == $format) {
|
||||||
return "\t<option value='$url'>$text</option>\n";
|
return "\t<option value='$url'>$text</option>\n";
|
||||||
} elseif ('html' == $format) {
|
} elseif ('html' == $format) {
|
||||||
return "\t<li>$before<a href='$url' title='$text'>$text</a>$after</li>\n";
|
return "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n";
|
||||||
} else { // custom
|
} else { // custom
|
||||||
return "\t$before<a href='$url' title='$text'>$text</a>$after\n";
|
return "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user