Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
32b5b25
Migrate to the new utf8.php decoder
adamziel Oct 31, 2025
196bd4e
Update composer.json files map
adamziel Oct 31, 2025
f82b874
polyfill _wp_can_use_pcre_u if missing
adamziel Oct 31, 2025
840d61d
use different namespaces for different files in case thats why compos…
adamziel Oct 31, 2025
15f1a64
update CI autoload
adamziel Oct 31, 2025
0499f8e
phpcs
adamziel Oct 31, 2025
ffd2309
tests
adamziel Nov 1, 2025
eb8201c
fix import
adamziel Nov 1, 2025
963b380
fix wp_scrub_utf8 reference
adamziel Nov 1, 2025
e43e00e
set matched_bytes in utf8_codepoint_at
adamziel Nov 1, 2025
70482ce
set matched_bytes in utf8_codepoint_at
adamziel Nov 1, 2025
0ea8488
Fix infinite loop
adamziel Nov 1, 2025
9db35e0
Restore the original utf8-decoder to see if that fixies the CI-only i…
adamziel Nov 1, 2025
b3d5d1f
Restore the original utf8 encoder
adamziel Nov 1, 2025
c9250d2
Improve CI autoloading
adamziel Nov 1, 2025
894d877
Use wp_is_valid_utf8 instead of wp_has_noncharacters
adamziel Nov 1, 2025
e1c078f
Remove unused import
adamziel Nov 1, 2025
fc74f22
Remove duplicate wp_utf8 function declarations
adamziel Nov 1, 2025
d6973cf
Remove unused legacy utf8 pipeline functions
adamziel Nov 1, 2025
05afd5d
Invert the condition
adamziel Nov 1, 2025
a9de875
Remove unused legacy utf8_substr function
adamziel Nov 1, 2025
049c8cb
Replace utf8_codepoint_at with _wp_scan_utf8
adamziel Nov 1, 2025
8a4b939
Pass $at by reference
adamziel Nov 1, 2025
0f159b4
Pass int as invalid_length
adamziel Nov 1, 2025
ec9187b
Reorganize parse_name
adamziel Nov 1, 2025
2f5b370
Restore utf8_codepoint_at-based processing
adamziel Nov 1, 2025
e327516
Remove unnecessary changes to CSSProcessor
adamziel Nov 1, 2025
27bf87f
PHPCS
adamziel Nov 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions components/Blueprints/class-runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
use WordPress\HttpClient\Client;
use WordPress\Zip\ZipFilesystem;

use function WordPress\Encoding\_wp_has_noncharacters_fallback;
use function WordPress\Encoding\wp_is_valid_utf8;
use function WordPress\Filesystem\wp_unix_sys_get_temp_dir;
use function WordPress\Zip\is_zip_file_stream;

Expand Down Expand Up @@ -379,14 +379,7 @@ private function load_blueprint() {
// Validate the Blueprint string we've just loaded.

// **UTF-8 Encoding:** Assert the Blueprint input is UTF-8 encoded.
$is_valid_utf8 = false;
if ( function_exists( 'mb_check_encoding' ) ) {
$is_valid_utf8 = mb_check_encoding( $blueprint_string, 'UTF-8' );
} else {
$is_valid_utf8 = ! _wp_has_noncharacters_fallback( $blueprint_string );
}

if ( ! $is_valid_utf8 ) {
if ( ! wp_is_valid_utf8( $blueprint_string ) ) {
throw new BlueprintExecutionException( 'Blueprint must be encoded as UTF-8.' );
}

Expand Down
6 changes: 3 additions & 3 deletions components/DataLiberation/URL/class-cssprocessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace WordPress\DataLiberation\URL;

use function WordPress\Encoding\_wp_scan_utf8;
use function WordPress\Encoding\_wp_scrub_utf8_fallback;
use function WordPress\Encoding\utf8_codepoint_at;
use function WordPress\Encoding\codepoint_to_utf8_bytes;
use function WordPress\Encoding\compat\_wp_scan_utf8;
use function WordPress\Encoding\wp_scrub_utf8;

/**
* Tokenizes CSS according to the CSS Syntax Level 3 specification.
Expand Down Expand Up @@ -1528,7 +1528,7 @@ private function consume_ident_start_codepoint( $at ): int {
*/
private function decode_string_or_url( int $start, int $length ): string {
// Fast path: check if any processing is needed.
$slice = _wp_scrub_utf8_fallback( substr( $this->css, $start, $length ) );
$slice = wp_scrub_utf8( substr( $this->css, $start, $length ) );
$special_chars = "\\\r\f\x00";
if ( false === strpbrk( $slice, $special_chars ) ) {
// No special chars - return raw substring (almost zero allocations).
Expand Down
Loading