Skip to content

Commit ca9a49f

Browse files
committed
Fix "ord(): Providing an empty string is deprecated" with PHP 8.5
1 parent 6cdf6d1 commit ca9a49f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wp-includes/mysql/class-wp-mysql-lexer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,15 +2615,15 @@ private function read_identifier(): ?int {
26152615
// If it can't, bail out early to avoid unnecessary UTF-8 decoding.
26162616
// Identifiers are usually ASCII-only, so we can optimize for that.
26172617
$byte_1 = ord(
2618-
$this->sql[ $this->bytes_already_read ] ?? ''
2618+
$this->sql[ $this->bytes_already_read ] ?? "\0"
26192619
);
26202620
if ( $byte_1 < 0xC2 || $byte_1 > 0xEF ) {
26212621
break;
26222622
}
26232623

26242624
// Look for a valid 2-byte UTF-8 symbol. Covers range U+0080 - U+07FF.
26252625
$byte_2 = ord(
2626-
$this->sql[ $this->bytes_already_read + 1 ] ?? ''
2626+
$this->sql[ $this->bytes_already_read + 1 ] ?? "\0"
26272627
);
26282628
if (
26292629
$byte_1 <= 0xDF
@@ -2635,7 +2635,7 @@ private function read_identifier(): ?int {
26352635

26362636
// Look for a valid 3-byte UTF-8 symbol in range U+0800 - U+FFFF.
26372637
$byte_3 = ord(
2638-
$this->sql[ $this->bytes_already_read + 2 ] ?? ''
2638+
$this->sql[ $this->bytes_already_read + 2 ] ?? "\0"
26392639
);
26402640
if (
26412641
$byte_1 <= 0xEF

0 commit comments

Comments
 (0)