Ticket #36738: 36738.diff
File 36738.diff, 1.4 KB (added by , 8 years ago) |
---|
-
wp-includes/post.php
3169 3169 $post_date = $postarr['post_date']; 3170 3170 } 3171 3171 3172 // Validate the date.3172 // Validate the post date. 3173 3173 $mm = substr( $post_date, 5, 2 ); 3174 3174 $jj = substr( $post_date, 8, 2 ); 3175 3175 $aa = substr( $post_date, 0, 4 ); … … 3176 3176 $valid_date = wp_checkdate( $mm, $jj, $aa, $post_date ); 3177 3177 if ( ! $valid_date ) { 3178 3178 if ( $wp_error ) { 3179 return new WP_Error( 'invalid_date', __( 'Whoops, the provided date is invalid.' ) );3179 return new WP_Error( 'invalid_date', __( 'Whoops, the provided post date is invalid.' ) ); 3180 3180 } else { 3181 3181 return 0; 3182 3182 } … … 3192 3192 $post_date_gmt = $postarr['post_date_gmt']; 3193 3193 } 3194 3194 3195 // Validate the post date gmt. 3196 $mm = substr( $post_date_gmt, 5, 2 ); 3197 $jj = substr( $post_date_gmt, 8, 2 ); 3198 $aa = substr( $post_date_gmt, 0, 4 ); 3199 $valid_date = wp_checkdate( $mm, $jj, $aa, $post_date_gmt ); 3200 if ( ! $valid_date ) { 3201 if ( $wp_error ) { 3202 return new WP_Error( 'invalid_date', __( 'Whoops, the provided post date gmt is invalid.' ) ); 3203 } else { 3204 return 0; 3205 } 3206 } 3207 3195 3208 if ( $update || '0000-00-00 00:00:00' == $post_date ) { 3196 3209 $post_modified = current_time( 'mysql' ); 3197 3210 $post_modified_gmt = current_time( 'mysql', 1 );