Ticket #17180: 17180-4.diff
File 17180-4.diff, 2.3 KB (added by , 12 years ago) |
---|
-
wp-includes/post.php
2547 2547 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) 2548 2548 $post_date = current_time('mysql'); 2549 2549 2550 // validate the date 2551 $mm = substr( $post_date, 5, 2 ); 2552 $jj = substr( $post_date, 8, 2 ); 2553 $aa = substr( $post_date, 0, 4 ); 2554 $valid_date = apply_filters( 'wp_insert_post_validate_date', checkdate( $mm, $jj, $aa ), $post_date ); 2555 if ( !$valid_date ) { 2556 return new WP_Error( 'invalid_date', __( 'Woops, the provided date is invalid.' ) ); 2557 } 2558 2550 2559 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { 2551 2560 if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) ) 2552 2561 $post_date_gmt = get_gmt_from_date($post_date); -
wp-admin/includes/post.php
122 122 $hh = ($hh > 23 ) ? $hh -24 : $hh; 123 123 $mn = ($mn > 59 ) ? $mn -60 : $mn; 124 124 $ss = ($ss > 59 ) ? $ss -60 : $ss; 125 $valid_date = apply_filters( '_wp_translate_postdata_valid_date', checkdate( $mm, $jj, $aa ), $post_data ); 126 if ( !$valid_date ) { 127 return new WP_Error( 'invalid_date', __( 'Woops, the provided date is invalid.' ) ); 128 } 125 129 $post_data['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); 126 130 $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); 127 131 } -
wp-admin/js/post.dev.js
528 528 return false; 529 529 }); 530 530 531 $('#post').submit(function(e){ 532 if ( !updateText() ) { 533 e.preventDefault(); 534 $('#timestampdiv').show(); 535 $('#publishing-action .ajax-loading').css('visibility', 'hidden'); 536 $('#publish').prop('disabled', false).removeClass('button-primary-disabled'); 537 return false; 538 } 539 }); 540 531 541 $('#post-status-select').siblings('a.edit-post-status').click(function() { 532 542 if ($('#post-status-select').is(":hidden")) { 533 543 $('#post-status-select').slideDown('fast');