Make WordPress Core

Changeset 10136


Ignore:
Timestamp:
12/09/2008 08:07:52 AM (16 years ago)
Author:
markjaquith
Message:

Only count specific comment approval types for the types we know about, to avoid a potential notice. fixes #8503

File:
1 edited

Legend:

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

    r10097 r10136  
    697697    $total = 0;
    698698    $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');
     699    $known_types = array_keys( $approved );
    699700    foreach( (array) $count as $row_num => $row ) {
    700701        $total += $row['num_comments'];
    701         $stats[$approved[$row['comment_approved']]] = $row['num_comments'];
     702        if ( in_array( $row['comment_approved'], $known_types ) )
     703            $stats[$approved[$row['comment_approved']]] = $row['num_comments'];
    702704    }
    703705
Note: See TracChangeset for help on using the changeset viewer.