Changeset 1840

Show
Ignore:
Timestamp:
11/01/04 13:21:14 (4 years ago)
Author:
donncha
Message:

Make sure email and name are not blank when checking comment author in whitelist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/functions.php

    r1829 r1840  
    16481648    // Comment whitelisting: 
    16491649    if ( 1 == get_settings('comment_whitelist')) { 
    1650         $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author_email = '$email' and comment_approved = '1' "); 
    1651         if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) ) 
     1650        if( $author != '' && $email != '' ) { 
     1651            $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author_email = '$email' and comment_approved = '1' "); 
     1652            if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) ) 
    16521653            return true; 
    1653     return false; 
     1654        } else { 
     1655            return false; 
     1656        } 
    16541657    } 
    16551658