Make WordPress Core

Changeset 57738


Ignore:
Timestamp:
02/28/2024 09:13:27 PM (13 months ago)
Author:
dmsnell
Message:

HTML API: Remove superfluous type-coercing empty() check.

When returning modifiable text in the HTML API, if the text segment
coerces to false inside empty(), then an empty string has been
returned instead of the string itself. For example, the text node in the
following HTML snippet:

    <div>0</div>

In this patch the empty() check is removed. The purpose of the original
check was to skip further processing if the text content is empty, but
the check is not needed and the additioanl processing is minimal.
Removing the code removes the defect and leaves a cleaner method in its
absence.

Developed in https://github.com/WordPress/wordpress-develop/pull/6199

Follow-up to [57348]
Follow-up to #60170

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.