Changeset 59957
- Timestamp:
- 03/09/2025 11:02:41 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r59915 r59957 41 41 42 42 // If manual moderation is enabled, skip all checks and return false. 43 if ( 1== get_option( 'comment_moderation' ) ) {43 if ( '1' === get_option( 'comment_moderation' ) ) { 44 44 return false; 45 45 } … … 127 127 * email address. If both checks pass, return true. Otherwise, return false. 128 128 */ 129 if ( 1== get_option( 'comment_previously_approved' ) ) {129 if ( '1' === get_option( 'comment_previously_approved' ) ) { 130 130 if ( 'trackback' !== $comment_type && 'pingback' !== $comment_type && '' !== $author && '' !== $email ) { 131 131 $comment_user = get_user_by( 'email', wp_unslash( $email ) ); 132 132 if ( ! empty( $comment_user->ID ) ) { 133 $ok_to_comment = $wpdb->get_var( $wpdb->prepare( "SELECT comment_approved FROM $wpdb->comments WHERE user_id = %d AND comment_approved = '1' LIMIT 1", $comment_user->ID ) ); 133 $ok_to_comment = $wpdb->get_var( 134 $wpdb->prepare( 135 "SELECT comment_approved 136 FROM $wpdb->comments 137 WHERE user_id = %d 138 AND comment_approved = '1' 139 LIMIT 1", 140 $comment_user->ID 141 ) 142 ); 134 143 } else { 135 144 // expected_slashed ($author, $email) 136 $ok_to_comment = $wpdb->get_var( $wpdb->prepare( "SELECT comment_approved FROM $wpdb->comments WHERE comment_author = %s AND comment_author_email = %s and comment_approved = '1' LIMIT 1", $author, $email ) ); 145 $ok_to_comment = $wpdb->get_var( 146 $wpdb->prepare( 147 "SELECT comment_approved 148 FROM $wpdb->comments 149 WHERE comment_author = %s 150 AND comment_author_email = %s 151 AND comment_approved = '1' 152 LIMIT 1", 153 $author, 154 $email 155 ) 156 ); 137 157 } 138 if ( ( 1 == $ok_to_comment ) && 139 140 158 159 if ( '1' === $ok_to_comment && ( empty( $mod_keys ) || ! str_contains( $email, $mod_keys ) ) ) { 160 return true; 141 161 } else { 142 162 return false;
Note: See TracChangeset
for help on using the changeset viewer.