Changeset 48121 for trunk/src/wp-includes/comment.php
- Timestamp:
- 06/22/2020 05:24:34 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/comment.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r48115 r48121 11 11 * 12 12 * If manual comment moderation is set in the administration, then all checks, 13 * regardless of their type and whitelist, will fail and the function will13 * regardless of their type and substance, will fail and the function will 14 14 * return false. 15 15 * 16 16 * If the number of links exceeds the amount in the administration, then the 17 * check fails. If any of the parameter contents match the blacklist ofwords,17 * check fails. If any of the parameter contents contain any disallowed words, 18 18 * then the check fails. 19 19 * 20 20 * If the comment author was approved before, then the comment is automatically 21 * whitelisted.21 * approved. 22 22 * 23 23 * If all checks pass, the function will return true. … … 127 127 * email address. If both checks pass, return true. Otherwise, return false. 128 128 */ 129 if ( 1 == get_option( 'comment_ whitelist' ) ) {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 ) ); … … 816 816 } 817 817 818 if ( wp_bl acklist_check(818 if ( wp_blocklist_check( 819 819 $commentdata['comment_author'], 820 820 $commentdata['comment_author_email'], … … 1263 1263 1264 1264 /** 1265 * Does comment contain blacklisted characters or words.1266 * 1267 * @since 1.5.01265 * Checks if a comment contains disallowed characters or words. 1266 * 1267 * @since 5.5.0 1268 1268 * 1269 1269 * @param string $author The author of the comment … … 1273 1273 * @param string $user_ip The comment author's IP address 1274 1274 * @param string $user_agent The author's browser user agent 1275 * @return bool True if comment contains blacklisted content, false if comment does not1276 */ 1277 function wp_bl acklist_check( $author, $email, $url, $comment, $user_ip, $user_agent ) {1275 * @return bool True if comment contains disallowed content, false if comment does not 1276 */ 1277 function wp_blocklist_check( $author, $email, $url, $comment, $user_ip, $user_agent ) { 1278 1278 /** 1279 * Fires before the comment is tested for blacklisted characters or words.1279 * Fires before the comment is tested for disallowed characters or words. 1280 1280 * 1281 1281 * @since 1.5.0 1282 * @deprecated 5.5.0 Use {@see 'wp_blocklist_check'} instead. 1282 1283 * 1283 1284 * @param string $author Comment author. … … 1288 1289 * @param string $user_agent Comment author's browser user agent. 1289 1290 */ 1290 do_action( 'wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent ); 1291 1292 $mod_keys = trim( get_option( 'blacklist_keys' ) ); 1291 do_action_deprecated( 'wp_blacklist_check', array( $author, $email, $url, $comment, $user_ip, $user_agent ), '5.5.0', 'wp_blocklist_check', __( 'Please consider writing more inclusive code.' ) ); 1292 1293 /** 1294 * Fires before the comment is tested for disallowed characters or words. 1295 * 1296 * @since 5.5.0 1297 * 1298 * @param string $author Comment author. 1299 * @param string $email Comment author's email. 1300 * @param string $url Comment author's URL. 1301 * @param string $comment Comment content. 1302 * @param string $user_ip Comment author's IP address. 1303 * @param string $user_agent Comment author's browser user agent. 1304 */ 1305 do_action( 'wp_blocklist_check', $author, $email, $url, $comment, $user_ip, $user_agent ); 1306 1307 $mod_keys = trim( get_option( 'blocklist_keys' ) ); 1293 1308 if ( '' === $mod_keys ) { 1294 1309 return false; // If moderation keys are empty. 1295 1310 } 1296 1311 1297 // Ensure HTML tags are not being used to bypass the blacklist.1312 // Ensure HTML tags are not being used to bypass the list of disallowed characters and words. 1298 1313 $comment_without_html = wp_strip_all_tags( $comment ); 1299 1314
Note: See TracChangeset
for help on using the changeset viewer.