Ticket #17180: 17180.diff
File 17180.diff, 2.2 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/post.php
108 108 $hh = $post_data['hh']; 109 109 $mn = $post_data['mn']; 110 110 $ss = $post_data['ss']; 111 $aa = ($aa <= 0 ) ? date('Y') : $aa; 112 $mm = ($mm <= 0 ) ? date('n') : $mm; 113 $jj = ($jj > 31 ) ? 31 : $jj; 114 $jj = ($jj <= 0 ) ? date('j') : $jj; 111 if( ! checkdate( $mm, $jj, $aa ) ) 112 return new WP_Error( 'invalid_publish_date', __( 'The publish date you supplied is invalid.' ) ); 113 115 114 $hh = ($hh > 23 ) ? $hh -24 : $hh; 116 115 $mn = ($mn > 59 ) ? $mn -60 : $mn; 117 116 $ss = ($ss > 59 ) ? $ss -60 : $ss; -
wp-admin/js/post.dev.js
376 376 originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() ); 377 377 currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); 378 378 379 379 380 if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) { 380 381 $('.timestamp-wrap', '#timestampdiv').addClass('form-invalid'); 382 $('#publish').prop('disabled', true); 381 383 return false; 382 384 } else { 383 385 $('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid'); 386 $('#publish').prop('disabled', false); 384 387 } 385 388 386 389 if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) { … … 489 492 $('#timestampdiv').siblings('a.edit-timestamp').click(function() { 490 493 if ($('#timestampdiv').is(":hidden")) { 491 494 $('#timestampdiv').slideDown('fast'); 495 $('#publish').prop('disabled', true); 492 496 $(this).hide(); 493 497 } 494 498 return false; … … 503 507 $('#mn').val($('#hidden_mn').val()); 504 508 $('#timestampdiv').siblings('a.edit-timestamp').show(); 505 509 updateText(); 510 $('#publish').prop('disabled', false); 506 511 return false; 507 512 }); 508 513