Make WordPress Core


Ignore:
Timestamp:
05/25/2015 05:58:52 PM (10 years ago)
Author:
wonderboymusic
Message:

get_comments() can return int, so a few places need to check if the return value is traversable before passing what is assumed to be an array.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r32175 r32600  
    767767
    768768    while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
     769        if ( ! is_array( $possible ) ) {
     770            break;
     771        }
    769772        foreach ( $possible as $comment ) {
    770773            if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) )
Note: See TracChangeset for help on using the changeset viewer.