From b6a13bf8ab881666d722db3b29acbf2a78ca0097 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Fri, 23 Apr 2004 04:03:10 +0000 Subject: [PATCH] Fix for empty comment bug. git-svn-id: http://svn.automattic.com/wordpress/trunk@1132 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-comment.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index 8a3db247f..10a86a70d 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -21,7 +21,7 @@ add_filter('comment_excerpt', 'remove_slashes', 5); add_filter('comment_excerpt', 'convert_chars'); function clean_url($url) { - $url = str_replace('http://url', '', $url); + if ('' == $url) return $url; $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url); $url = str_replace(';//', '://', $url); $url = (!strstr($url, '://')) ? 'http://'.$url : $url; @@ -122,17 +122,13 @@ function comment_author_link() { global $comment; $url = apply_filters('comment_url', $comment->comment_author_url); $author = apply_filters('comment_author', $comment->comment_author); + if (!$author) $author = 'Anonymous'; - if (empty($url) && empty($email)) { - echo 'Anonymous'; - return; - } - - echo '' . $author . ''; + if (empty($url)) : + echo $author; + else: + echo "$author"; + endif; } function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') {