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

WordPress Trac noreply at wordpress.org
Sun Dec 15 18:13:17 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:  high          |   Milestone:  5.3.2
Component:  Date/Time     |     Version:  5.3.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------
Changes (by azaozz):

 * priority:  normal => high


Comment:

 What would be the best fix here? I can see this happening in other
 cases/for CPTs perhaps. Would it be enough to check the returned value
 from `date_create_immutable_from_format()` or perhaps have a wrapper for
 it that can handle ...other exceptions/errors?

 Looking at the PHP docs (for
 [https://www.php.net/manual/en/datetime.createfromformat.php
 date_create_from_format] which is like
 [https://www.php.net/manual/en/datetimeimmutable.createfromformat.php
 date_create_immutable_from_format]), specifically at
 https://www.php.net/manual/en/datetime.createfromformat.php#refsect1-datetime
 .createfromformat-parameters, it implies some possible errors when the
 same strings like for `date()` are used.

 Setting this to high priority as a fatal is a fatal, needs fixing asap :)

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


More information about the wp-trac mailing list