[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
Sun Jul 25 09:55:48 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:
---------------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51485" 51485]:
 {{{
 #!CommitTicketReference repository="" revision="51485"
 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.
 Fixes #53773.
 }}}

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


More information about the wp-trac mailing list