[wp-trac] [WordPress Trac] #45430: With PHP 7.2 - Warning error on wp-includes/post-template.php

WordPress Trac noreply at wordpress.org
Tue Nov 27 09:16:43 UTC 2018


#45430: With PHP 7.2 - Warning error on wp-includes/post-template.php
-------------------------------+-----------------------------------
 Reporter:  jtibbles           |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  4.9.8
 Severity:  normal             |   Keywords:  2nd-opinion has-patch
  Focuses:                     |
-------------------------------+-----------------------------------
 Following warning is displayed in code when viewing a single post, when
 using PHP7.2:

 Warning
 : count(): :  count(): Parameter must be an array or an object that
 implements Countable in
 /xxxx/wp-includes/post-template.php

 Suggested patch ammend: replace line 284 in wp-includes/post-template.php:
         if ( $page > count( $pages ) ) // if the requested page doesn't
 exist
 ...with the following:
         if ( empty($pages) === false && $page > count( $pages ) ) // if
 the requested page doesn't exist

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


More information about the wp-trac mailing list