Make WordPress Core


Ignore:
Timestamp:
08/18/2020 03:08:19 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r48603 r48817  
    38093809    $raw_excerpt = $text;
    38103810
    3811     if ( '' === $text ) {
     3811    if ( '' === trim( $text ) ) {
    38123812        $post = get_post( $post );
    38133813        $text = get_the_content( '', false, $post );
Note: See TracChangeset for help on using the changeset viewer.