Make WordPress Core

Ticket #41227: 41227.patch

File 41227.patch, 1.3 KB (added by shamim51, 6 years ago)
  • post.php

     
    31443144                $post_date_gmt = $postarr['post_date_gmt'];
    31453145        }
    31463146
    3147         if ( $update || '0000-00-00 00:00:00' == $post_date ) {
     3147        if( ( ! empty( $postarr['post_modified'] ) && '0000-00-00 00:00:00' != $postarr['post_modified'] ) || ( ! empty( $postarr['post_modified_gmt'] ) && '0000-00-00 00:00:00' != $postarr['post_modified_gmt'] ) ){
     3148                if ( empty( $postarr['post_modified'] ) || '0000-00-00 00:00:00' == $postarr['post_modified'] ) {
     3149                        if ( empty( $postarr['post_modified_gmt'] ) || '0000-00-00 00:00:00' == $postarr['post_modified_gmt'] ) {
     3150                                $post_modified = current_time( 'mysql' );
     3151                        } else {
     3152                                $post_modified = get_date_from_gmt( $postarr['post_modified_gmt'] );
     3153                        }
     3154                } else {
     3155                        $post_modified = $postarr['post_modified'];
     3156                }
     3157               
     3158                if ( empty( $postarr['post_modified_gmt'] ) || '0000-00-00 00:00:00' == $postarr['post_modified_gmt'] ) {
     3159                        $post_modified_gmt = get_gmt_from_date( $post_modified );
     3160                } else {
     3161                        $post_modified_gmt = $postarr['post_modified_gmt'];
     3162                }
     3163        } elseif ( $update || '0000-00-00 00:00:00' == $post_date ) {
    31483164                $post_modified     = current_time( 'mysql' );
    31493165                $post_modified_gmt = current_time( 'mysql', 1 );
    31503166        } else {