[wp-trac] [WordPress Trac] #57035: Error in current_time() function when using timestamp and no value for gmt_offset

WordPress Trac noreply at wordpress.org
Thu Aug 22 23:25:33 UTC 2024


#57035: Error in current_time() function when using timestamp and no value for
gmt_offset
-------------------------------------------------+-------------------------
 Reporter:  Nick_theGeek                         |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.7
Component:  Date/Time                            |     Version:  5.3
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests php80 dev-  |     Focuses:
  feedback commit                                |
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58923" 58923]:
 {{{
 #!CommitTicketReference repository="" revision="58923"
 Date/Time: Prevent type errors in `current_time()`.

 Prevents a potential type error when calling `current_time( 'timestamp' )`
 by casting `get_option( 'gmt_offset' )` to a float prior to performing
 calculations with the value.

 This mainly accounts for incorrect storage of values, such as an empty
 string or city name.

 Follow up to [45856], [55054], [55598].

 Props hellofromtonya, peterwilsoncc, rarst, costdev, Nick_theGeek,
 SergeyBiryukov, johnbillion, desrosj, reputeinfosystems, audrasjb,
 oglekler.
 Fixes #57035.
 }}}

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


More information about the wp-trac mailing list