Ticket #7552: delete-spam-time-check.patch
| File delete-spam-time-check.patch, 1.3 KB (added by , 17 years ago) |
|---|
-
wp-admin/edit-comments.php
14 14 wp_enqueue_script( 'admin-forms' ); 15 15 wp_enqueue_script( 'jquery-table-hotkeys' ); 16 16 17 if ( isset( $_POST['delete_all_spam'] ) || isset( $_POST['delete_all_spam2'] ) ) {17 if ( ( isset( $_POST['delete_all_spam'] ) || isset( $_POST['delete_all_spam2'] ) ) && !empty( $_POST['pagegen_timestamp'] ) ) { 18 18 check_admin_referer('bulk-spam-delete'); 19 19 20 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam'" ); 20 $formtime = (int) $_POST['pagegen_timestamp']; 21 22 $deleted_spam = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_date_gmt < FROM_UNIXTIME(%d)", $formtime ) ); 21 23 wp_redirect('edit-comments.php?deleted=' . (int) $deleted_spam); 22 24 } 23 25 … … 208 210 <form id="comments-form" action="" method="post"> 209 211 <input type="hidden" name="mode" value="<?php echo $mode; ?>" /> 210 212 <input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" /> 213 <input type="hidden" name="pagegen_timestamp" value="<?php echo current_time( 'timestamp', TRUE ); ?>" /> 211 214 212 215 <div class="tablenav"> 213 216