From a4f6f2beaec7c14ff08dc099b34ef81efead1dc7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 14 Apr 2020 11:32:06 +0000 Subject: [PATCH] Mail: Make the check for empty post title in `wp-mail.php` more resilient. This addresses a regression in [47054], which caused posts sent via email to published with an empty title. Props whyisjake, Otto42, MarkRH, MattyRob, mukesh27, afragen, pikamander2. Fixes #49853. Built from https://develop.svn.wordpress.org/trunk@47580 git-svn-id: http://core.svn.wordpress.org/trunk@47355 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-mail.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 307253501c..0a1ad8d6de 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47578'; +$wp_version = '5.5-alpha-47580'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-mail.php b/wp-mail.php index 02635157c5..1d5fbedf03 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -213,7 +213,7 @@ for ( $i = 1; $i <= $count; $i++ ) { $post_title = xmlrpc_getposttitle( $content ); - if ( '' === $post_title ) { + if ( '' === trim( $post_title ) ) { $post_title = $subject; }