fixed bug in comment_author_link.

git-svn-id: http://svn.automattic.com/wordpress/trunk@193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-06-08 10:12:50 +00:00
parent faadf27271
commit 0e1ccae1a1
1 changed files with 7 additions and 4 deletions

View File

@ -980,15 +980,18 @@ function comment_author_link() {
$url = str_replace('http://url', '', $url); $url = str_replace('http://url', '', $url);
if (empty($url) && empty($email)) return $author; if (empty($url) && empty($email)) {
echo $author;
return;
}
echo '<a href="'; echo '<a href="';
if ($url) { if ($url) {
$url = str_replace(';//', '://', $url); $url = str_replace(';//', '://', $url);
$url = (!strstr($url, '://')) ? 'http://'.$url : $url; $url = (!strstr($url, '://')) ? 'http://'.$url : $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url); $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
echo $url; else echo $url;
} else { } else {
echo antispambot($email); echo 'mailto:'.$email;
} }
echo '" rel="external">' . $author . '</a>'; echo '" rel="external">' . $author . '</a>';
} }