Make WordPress Core

Ticket #58986: ticket-patch-58986.diff

File ticket-patch-58986.diff, 821 bytes (added by mhshohel, 16 months ago)

Implemented a patch to perform a type cast on 'gmt_offset'. Additionally, incorporated a standard practice by introducing a default value of 0.

  • src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    18021802                         * with the site's timezone offset applied.
    18031803                         */
    18041804                        if ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) {
    1805                                 $post_modified_gmt = gmdate( 'Y-m-d H:i:s', strtotime( $post->post_modified ) - ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) );
     1805                                $post_modified_gmt = gmdate( 'Y-m-d H:i:s', strtotime( $post->post_modified ) - ( (int) get_option( 'gmt_offset', 0 ) * HOUR_IN_SECONDS ) );
    18061806                        } else {
    18071807                                $post_modified_gmt = $post->post_modified_gmt;
    18081808                        }