Fallback support for determining if a string contains Unicode noncharacters.
Description
See also
Parameters
$textstringrequired- Are there noncharacters in this string?
Source
function _wp_has_noncharacters_fallback( string $text ): bool {
$at = 0;
$invalid_length = 0;
$has_noncharacters = false;
$end = strlen( $text );
while ( $at < $end && ! $has_noncharacters ) {
_wp_scan_utf8( $text, $at, $invalid_length, null, null, $has_noncharacters );
$at += $invalid_length;
}
return $has_noncharacters;
}
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.