Skip to content

Commit 0716d74

Browse files
authored
Merge branch 'trunk' into migrate-urls-in-css
2 parents 123f36d + 72c1176 commit 0716d74

File tree

8 files changed

+1048
-1002
lines changed

8 files changed

+1048
-1002
lines changed

components/Blueprints/class-runner.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
use WordPress\HttpClient\Client;
5656
use WordPress\Zip\ZipFilesystem;
5757

58-
use function WordPress\Encoding\_wp_has_noncharacters_fallback;
58+
use function WordPress\Encoding\wp_is_valid_utf8;
5959
use function WordPress\Filesystem\wp_unix_sys_get_temp_dir;
6060
use function WordPress\Zip\is_zip_file_stream;
6161

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

381381
// **UTF-8 Encoding:** Assert the Blueprint input is UTF-8 encoded.
382-
$is_valid_utf8 = false;
383-
if ( function_exists( 'mb_check_encoding' ) ) {
384-
$is_valid_utf8 = mb_check_encoding( $blueprint_string, 'UTF-8' );
385-
} else {
386-
$is_valid_utf8 = ! _wp_has_noncharacters_fallback( $blueprint_string );
387-
}
388-
389-
if ( ! $is_valid_utf8 ) {
382+
if ( ! wp_is_valid_utf8( $blueprint_string ) ) {
390383
throw new BlueprintExecutionException( 'Blueprint must be encoded as UTF-8.' );
391384
}
392385

components/DataLiberation/URL/class-cssprocessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace WordPress\DataLiberation\URL;
44

5-
use function WordPress\Encoding\utf8_codepoint_at;
65
use function WordPress\Encoding\codepoint_to_utf8_bytes;
76
use function WordPress\Encoding\compat\_wp_scan_utf8;
7+
use function WordPress\Encoding\utf8_ord;
88
use function WordPress\Encoding\wp_scrub_utf8;
99

1010
/**
@@ -1532,7 +1532,7 @@ private function consume_ident_start_codepoint( $at ): int {
15321532
}
15331533

15341534
$codepoint_byte_length = $new_at - $at;
1535-
$codepoint = utf8_codepoint_at( $this->css, $at );
1535+
$codepoint = utf8_ord( substr( $this->css, $at, $codepoint_byte_length ) );
15361536
if ( null !== $codepoint && $codepoint >= 0x80 ) {
15371537
return $codepoint_byte_length;
15381538
}

0 commit comments

Comments
 (0)