Changeset 48207
- Timestamp:
- 06/28/2020 09:40:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r48199 r48207 871 871 * @param string $date MySQL time string. 872 872 * @param bool $avoid_die When true, a disallowed comment will result in the function 873 * returning a WP_Error object, rather than executing wp_die(). 874 * Default false. 873 * returning without executing wp_die() or die(). Default false. 875 874 * @return bool Whether comment flooding is occurring. 876 875 */ … … 888 887 return false; 889 888 } 889 890 890 $hour_ago = gmdate( 'Y-m-d H:i:s', time() - HOUR_IN_SECONDS ); 891 891 … … 898 898 } 899 899 900 $sql 900 $sql = $wpdb->prepare( 901 901 "SELECT `comment_date_gmt` FROM `$wpdb->comments` WHERE `comment_date_gmt` >= %s AND ( $check_column = %s OR `comment_author_email` = %s ) ORDER BY `comment_date_gmt` DESC LIMIT 1", 902 902 $hour_ago, … … 904 904 $email 905 905 ); 906 906 907 $lasttime = $wpdb->get_var( $sql ); 908 907 909 if ( $lasttime ) { 908 910 $time_lastcomment = mysql2date( 'U', $lasttime, false ); 909 911 $time_newcomment = mysql2date( 'U', $date, false ); 912 910 913 /** 911 914 * Filters the comment flood status. … … 918 921 */ 919 922 $flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment ); 923 920 924 if ( $flood_die ) { 921 925 /** … … 929 933 do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment ); 930 934 931 if ( true ===$avoid_die ) {935 if ( $avoid_die ) { 932 936 return true; 933 937 } else {
Note: See TracChangeset
for help on using the changeset viewer.