Make WordPress Core


Ignore:
Timestamp:
04/23/2004 04:03:10 AM (21 years ago)
Author:
saxmatt
Message:

Fix for empty comment bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-comment.php

    r1108 r1132  
    2222
    2323function clean_url($url) {
    24     $url = str_replace('http://url', '', $url);
     24    if ('' == $url) return $url;
    2525    $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
    2626    $url = str_replace(';//', '://', $url);
     
    123123    $url = apply_filters('comment_url', $comment->comment_author_url);
    124124    $author = apply_filters('comment_author', $comment->comment_author);
    125 
    126     if (empty($url) && empty($email)) {
    127         echo 'Anonymous';
    128         return;
    129     }
    130 
    131     echo '<a href="';
    132     if ($url) {
    133         echo $url;
    134     }
    135     echo '" rel="external">' . $author . '</a>';
     125    if (!$author) $author = 'Anonymous';
     126
     127    if (empty($url)) :
     128        echo $author;
     129    else:
     130        echo "<a href='$url' rel='external'>$author</a>";
     131    endif;
    136132}
    137133
Note: See TracChangeset for help on using the changeset viewer.