[wp-trac] [WordPress Trac] #25273: wp_link_pages shouldn't be able to use a negative page number

WordPress Trac noreply at wordpress.org
Fri Feb 21 17:42:53 UTC 2014


#25273: wp_link_pages shouldn't be able to use a negative page number
-----------------------------------+------------------------------
 Reporter:  betzster               |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Posts, Post Types      |     Version:  trunk
 Severity:  trivial                |  Resolution:
 Keywords:  2nd-opinion has-patch  |     Focuses:  template
-----------------------------------+------------------------------
Changes (by jessepollak):

 * keywords:   => 2nd-opinion has-patch
 * version:   => trunk
 * severity:  normal => trivial


Comment:

 Thanks for the bug report betzser, sorry it didn't get a faster response!

 This issue is still around in trunk revision 27076.

 To recreate the issue, run inside of The Loop:


 {{{
 global  $multipage, $page, $more;
 $multipage = true;
 $page = 0;
 $more = true;

 wp_link_pages(array('next_or_number' => 'next'));
 }}}

 This creates "Previous page" links where the link goes to a page with the
 index -1.

 The only situation where this is an issue is when the $page ID <= 0, which
 I'm not sure ever really happens. That said, it's a tiny fix, so it may be
 worth just merging in because why not.

 I'll defer to the core team to decide whether the existing patch should be
 accepted.

 Thanks again for the report betzster!

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


More information about the wp-trac mailing list