[wp-trac] [WordPress Trac] #53773: /wp-admin/includes/ajax-actions.php file line 3006 is creating divide by zero error

WordPress Trac noreply at wordpress.org
Wed Jul 28 13:01:46 UTC 2021


#53773: /wp-admin/includes/ajax-actions.php file line 3006 is creating divide by
zero error
-------------------------------------------------+-------------------------
 Reporter:  2linctools                           |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.8.1
Component:  Media                                |     Version:  5.8
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch commit      |     Focuses:
  fixed-major                                    |
-------------------------------------------------+-------------------------
Changes (by desrosj):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51507" 51507]:
 {{{
 #!CommitTicketReference repository="" revision="51507"
 Media: Check the `posts_per_page` value in `wp_ajax_query_attachments()`
 before using it as a divisor.

 This avoids a "Division by zero" PHP warning if a plugin changes the
 `posts_per_page` value to zero.

 Follow-up to [51145].

 Props 2linctools, kapilpaul, audrasjb, SergeyBiryukov.
 Merges [51485] to the 5.8 branch.
 Fixes #53773.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53773#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list