Skip to content

Commit 72c1176

Browse files
authored
[CSSProcessor] Replace utf8_codepoint_at with utf8_ord (#202)
Replaces the `utf8_codepoint_at()` call in `CSSProcessor` with `utf8_ord()`. This removes the last reference to `utf8_codepoint_at()` from the codebase so the next PR will remove that function, see #200 for prior context. cc @dmsnell
1 parent e434a3a commit 72c1176

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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
/**
@@ -1506,7 +1506,7 @@ private function consume_ident_start_codepoint( $at ): int {
15061506
}
15071507

15081508
$codepoint_byte_length = $new_at - $at;
1509-
$codepoint = utf8_codepoint_at( $this->css, $at );
1509+
$codepoint = utf8_ord( substr( $this->css, $at, $codepoint_byte_length ) );
15101510
if ( null !== $codepoint && $codepoint >= 0x80 ) {
15111511
return $codepoint_byte_length;
15121512
}

0 commit comments

Comments
 (0)