[wp-trac] [WordPress Trac] #57401: post-template.php fails to check if $elements['page'] is zero causing an array index error

WordPress Trac noreply at wordpress.org
Thu Dec 29 17:20:43 UTC 2022


#57401: post-template.php fails to check if $elements['page'] is zero causing an
array index error
--------------------------+-----------------------------
 Reporter:  mjdewitt      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This throws a warning:

 Warning: Undefined array key -1 in /wp-includes/post-template.php on line
 327

 I'm not sure when this started showing up. I think it's happening in the
 handling scheduled posts.

 Perhaps this is all that is needed?

 326:         $page_no = $elements['page'] ? $elements['page'] : 1;

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


More information about the wp-trac mailing list