[wp-trac] [WordPress Trac] #31116: Infunitum loop in the media load page, media-models.min.js

WordPress Trac noreply at wordpress.org
Sat Jan 24 03:59:24 UTC 2015


#31116: Infunitum loop in the media load page, media-models.min.js
-----------------------------------------------+---------------------------
 Reporter:  Veritaserum                        |      Owner:
     Type:  defect (bug)                       |     Status:  new
 Priority:  normal                             |  Milestone:  Awaiting
Component:  Media                              |  Review
 Severity:  normal                             |    Version:  4.1
  Focuses:  ui, accessibility, administration  |   Keywords:
-----------------------------------------------+---------------------------
 The following bug causes infinite loop in the media library grid:

 '''e.paged=Math.floor(this.length/e.posts_per_page)+1'''
 if this.length = 159;
 and e.posts_per_page = 40;
 you will always return a e.paged = 4;

 How is this done, the math before adding one is 3.975 at flooring comes to
 3 then add 1.

 Resolve this with '''Math.round(this.length/e.posts_per_page)+1''' . This
 is the only way to be sure that the paged number is safe and will not
 repeat.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31116>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list