From 6081c85b6c844401d009e40d7392c96582648fe5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 14 Apr 2020 11:34:16 +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. Merges [47580] to the 5.4 branch. Fixes #49853. Built from https://develop.svn.wordpress.org/branches/5.4@47581 git-svn-id: http://core.svn.wordpress.org/branches/5.4@47356 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 6f11498f42..247e8e266e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4.1-alpha-47579'; +$wp_version = '5.4.1-alpha-47581'; /** * 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; }