mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Date/Time: Replace all instances of date() with gmdate().
Use of `date()` in core depends on PHP timezone set to UTC and not changed by third party code (which cannot be guaranteed). `gmdate()` is functionally equivalent, but is not affected by PHP timezone setting: it's always UTC, which is the exact behavior the core needs. Props nielsdeblaauw, Rarst. Fixes #46438. See #44491. git-svn-id: https://develop.svn.wordpress.org/trunk@45424 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -863,11 +863,11 @@ function wp_dashboard_recent_posts( $args ) {
|
||||
$posts->the_post();
|
||||
|
||||
$time = get_the_time( 'U' );
|
||||
if ( date( 'Y-m-d', $time ) == $today ) {
|
||||
if ( gmdate( 'Y-m-d', $time ) == $today ) {
|
||||
$relative = __( 'Today' );
|
||||
} elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
|
||||
} elseif ( gmdate( 'Y-m-d', $time ) == $tomorrow ) {
|
||||
$relative = __( 'Tomorrow' );
|
||||
} elseif ( date( 'Y', $time ) !== $year ) {
|
||||
} elseif ( gmdate( 'Y', $time ) !== $year ) {
|
||||
/* translators: date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */
|
||||
$relative = date_i18n( __( 'M jS Y' ), $time );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user