From 13647464a5e74fbccafbe97f7c7dfdf38c337a6b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 18 Aug 2020 15:10:04 +0000 Subject: [PATCH] Formatting: Make the check for empty text in `wp_trim_excerpt()` more resilient. This addresses a regression in [47808], which caused excerpts to be generated from post content if an empty string is passed, but not for other values considered empty, e.g. `null` or `false`. Props riaanlom, laxman-prajapati, SergeyBiryukov. Fixes #51042. Built from https://develop.svn.wordpress.org/trunk@48817 git-svn-id: http://core.svn.wordpress.org/trunk@48579 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index d031656d43..9159ae4c69 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3808,7 +3808,7 @@ function human_time_diff( $from, $to = 0 ) { function wp_trim_excerpt( $text = '', $post = null ) { $raw_excerpt = $text; - if ( '' === $text ) { + if ( '' === trim( $text ) ) { $post = get_post( $post ); $text = get_the_content( '', false, $post ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 52473d45c7..4d1bfea97a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-48816'; +$wp_version = '5.6-alpha-48817'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.