Make WordPress Core

Changeset 43594


Ignore:
Timestamp:
08/30/2018 12:12:55 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Make sure current_time() always calculates the offset from GMT/UTC.

Previously, UTC context was implied, but could be unreliable due to being affected by plugins.

Props Rarst, rahulsprajapati, marco.marsala.
Fixes #37440.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r43587 r43594  
    7070            return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
    7171        default:
    72             return ( $gmt ) ? date( $type ) : date( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
     72            return ( $gmt ) ? gmdate( $type ) : gmdate( $type, time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
    7373    }
    7474}
Note: See TracChangeset for help on using the changeset viewer.