Changes between Initial Version and Version 2 of Ticket #57035
- Timestamp:
- 11/08/2022 01:40:58 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #57035
- Property Keywords has-patch php8 added
-
Property
Component
changed from
General
toDate/Time
-
Property
Milestone
changed from
Awaiting Review
to6.2
-
Ticket #57035 – Description
initial v2 5 5 It looks like the function has some typecasting, but it is placed in the wrong spot. 6 6 7 ` 7 {{{ 8 8 // Don't use non-GMT timestamp, unless you know the difference and really need to. 9 9 if ( 'timestamp' === $type || 'U' === $type ) { 10 10 return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); 11 11 } 12 ` 12 }}} 13 13 14 14 Should be 15 15 16 ` 16 {{{ 17 17 // Don't use non-GMT timestamp, unless you know the difference and really need to. 18 18 if ( 'timestamp' === $type || 'U' === $type ) { 19 19 return $gmt ? time() : time() + ( (int) get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); 20 20 } 21 ` 21 }}} 22 22 23 Again, this is potentially an edge case. Another ticket was reported and closed when the user discovered a work around, but I think this fix is pretty simple and will solve for weird edge cases that can break sites in php8. 24 https://core.trac.wordpress.org/ticket/56358 23 Again, this is potentially an edge case. Another ticket, #56358, was reported and closed when the user discovered a work around, but I think this fix is pretty simple and will solve for weird edge cases that can break sites in php8.