[wp-trac] [WordPress Trac] #48957: Call to a member function format() on boolean in wp-includes/feed.php

WordPress Trac noreply at wordpress.org
Fri Dec 13 05:46:54 UTC 2019


#48957: Call to a member function format() on boolean in wp-includes/feed.php
--------------------------+-----------------------------
 Reporter:  dd32          |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Date/Time     |    Version:  5.3.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 [46774] / #48675 is causing a PHP fatal on buddypress.org, that may
 ultimately be caused by BuddyPress, but either way is a new core fatal
 condition as of 5.3.1.

 {{{
 Fatal error: Uncaught Error: Call to a member function format() on boolean
 in wp-includes/feed.php on line 692
 }}}

 The root cause of the issue is that the `WP_Post` object appears to have
 been emptied by BP similar to this:
 https://github.com/buddypress/BuddyPress/blob/fe47890c1ab7e2cb24c005f1c35fb9c6c8c8ab7c/src
 /bp-members/classes/class-bp-members-theme-compat.php#L119-L136

 That ultimately means that `$modified_times` is `[ 0 ]` which causes
 `date_create_immutable_from_format()` to return false instead of the
 expected `DateTime` object.

 cc @SergeyBiryukov @johnjamesjacoby

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


More information about the wp-trac mailing list