From 59ca490c66cf0a7c281f21048e382c4c64599c93 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 22 Oct 2020 02:47:07 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/5.5@49273 git-svn-id: http://core.svn.wordpress.org/branches/5.5@49035 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index d89701cc21..aa6e3d8980 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -3912,7 +3912,7 @@ class wp_xmlrpc_server extends IXR_Server { $comment['user_ID'] = 0; if ( get_option( 'require_name_email' ) ) { - if ( strlen( $comment['comment_author_email'] < 6 ) || '' === $comment['comment_author'] ) { + if ( strlen( $comment['comment_author_email'] ) < 6 || '' === $comment['comment_author'] ) { return new IXR_Error( 403, __( 'Comment author name and email are required.' ) ); } elseif ( ! is_email( $comment['comment_author_email'] ) ) { return new IXR_Error( 403, __( 'A valid email address is required.' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 455ac4649e..8f41078613 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5.2-alpha-49191'; +$wp_version = '5.5.2-alpha-49273'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.