Make WordPress Core


Ignore:
Timestamp:
10/22/2020 02:45:47 AM (4 years ago)
Author:
peterwilsoncc
Message:

XML-RPC: Fix length validation of anonymous commenter's email address.

Fix the first step of validating an anonymous commenters in which the length is checked prior to running regular expressions.

Follow up to [47808].
Merges [49271] to the 5.5 branch.
Fixes #51595.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/wp-includes/class-wp-xmlrpc-server.php

    r48590 r49273  
    39133913
    39143914            if ( get_option( 'require_name_email' ) ) {
    3915                 if ( strlen( $comment['comment_author_email'] < 6 ) || '' === $comment['comment_author'] ) {
     3915                if ( strlen( $comment['comment_author_email'] ) < 6 || '' === $comment['comment_author'] ) {
    39163916                    return new IXR_Error( 403, __( 'Comment author name and email are required.' ) );
    39173917                } elseif ( ! is_email( $comment['comment_author_email'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.