Changeset 21921
- Timestamp:
- 09/19/2012 09:43:35 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r21857 r21921 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'] ); -
trunk/wp-admin/js/post.js
r21789 r21921 527 527 } 528 528 return false; 529 }); 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 } 529 539 }); 530 540 -
trunk/wp-includes/post.php
r21847 r21921 2634 2634 $post_date = current_time('mysql'); 2635 2635 2636 // validate the date 2637 $mm = substr( $post_date, 5, 2 ); 2638 $jj = substr( $post_date, 8, 2 ); 2639 $aa = substr( $post_date, 0, 4 ); 2640 $valid_date = apply_filters( 'wp_insert_post_validate_date', checkdate( $mm, $jj, $aa ), $post_date ); 2641 if ( !$valid_date ) { 2642 return new WP_Error( 'invalid_date', __( 'Woops, the provided date is invalid.' ) ); 2643 } 2644 2636 2645 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { 2637 2646 if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
Note: See TracChangeset
for help on using the changeset viewer.