From 7ef97cfb108dd89e7304238bedbcd8ce858269a3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 14 Apr 2020 11:30:35 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@47580 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-mail.php b/src/wp-mail.php index 02635157c5..1d5fbedf03 100644 --- a/src/wp-mail.php +++ b/src/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; }