Make WordPress Core

Ticket #53773: 53773.diff

File 53773.diff, 673 bytes (added by kapilpaul, 3 years ago)

Created patch.

  • src/wp-admin/includes/ajax-actions.php

    diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
    index a4ed8efbfc..c05345e6e2 100644
    a b function wp_ajax_query_attachments() { 
    30033003                $total_posts = $count_query->found_posts;
    30043004        }
    30053005
    3006         $max_pages = ceil( $total_posts / (int) $attachments_query->query['posts_per_page'] );
     3006        $posts_per_page = (int) $attachments_query->query['posts_per_page'];
     3007
     3008        $max_pages = $posts_per_page ? ceil( $total_posts / $posts_per_page ) : 0;
    30073009
    30083010        header( 'X-WP-Total: ' . (int) $total_posts );
    30093011        header( 'X-WP-TotalPages: ' . (int) $max_pages );