Make WordPress Core

Ticket #44162: 44162.diff

File 44162.diff, 1.3 KB (added by thrijith, 7 years ago)
  • src/wp-admin/edit-form-advanced.php

     
    2828                )
    2929        );
    3030
    31         if ( count( $check_users ) > 1 ) {
     31        if ( is_countable( $check_users ) && count( $check_users ) > 1 ) {
    3232                add_action( 'admin_footer', '_admin_notice_post_locked' );
    3333        }
    3434
     
    249249        $revisions = wp_get_post_revisions( $post_ID );
    250250
    251251        // We should aim to show the revisions meta box only when there are revisions.
    252         if ( count( $revisions ) > 1 ) {
     252        if ( is_countable( $revisions ) && count( $revisions ) > 1 ) {
    253253                reset( $revisions ); // Reset pointer for key()
    254254                $publish_callback_args = array(
    255255                        'revisions_count' => count( $revisions ),
     
    294294        add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
    295295}
    296296
    297 if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {
     297if ( post_type_supports( $post_type, 'page-attributes' ) || ( is_countable( get_page_templates( $post ) ) && count( get_page_templates( $post ) ) > 0 ) ) {
    298298        add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core' );
    299299}
    300300