added htmlspecialchars to outputing comment author name, added 'Anonymous' as a default if no name provided

git-svn-id: https://develop.svn.wordpress.org/trunk@595 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Alex King 2003-12-09 17:16:28 +00:00
parent c4c6b9439e
commit 652d170af2
1 changed files with 16 additions and 3 deletions

View File

@ -1496,7 +1496,12 @@ function comment_ID() {
function comment_author() {
global $comment;
echo stripslashes($comment->comment_author);
if (!empty($comment->comment_author)) {
echo htmlspecialchars(stripslashes($comment->comment_author));
}
else {
echo "Anonymous";
}
}
function comment_author_email() {
@ -1508,7 +1513,10 @@ function comment_author_link() {
global $comment;
$url = trim(stripslashes($comment->comment_author_url));
$email = stripslashes($comment->comment_author_email);
$author = stripslashes($comment->comment_author);
$author = htmlspecialchars(stripslashes($comment->comment_author));
if (empty($author)) {
$author = "Anonymous";
}
$url = str_replace('http://url', '', $url);
@ -1619,7 +1627,12 @@ function comments_rss_link($link_text='Comments RSS', $commentsrssfilename = 'wp
function comment_author_rss() {
global $comment;
echo strip_tags(stripslashes($comment->comment_author));
if (!empty($comment->comment_author)) {
echo htmlspecialchars(strip_tags(stripslashes($comment->comment_author)));
}
else {
echo "Anonymous";
}
}
function comment_text_rss() {