Skip to content

Commit fdd004b

Browse files
committed
ID matches depend on quirks mode
1 parent c2e8c2f commit fdd004b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wp-includes/html-api/class-wp-css-selectors.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,10 @@ public static function parse( string $input, int &$offset ): ?self {
575575
}
576576

577577
public function matches( WP_HTML_Processor $processor ): bool {
578-
// @todo check case sensitivity.
579-
return $processor->get_attribute( 'id' ) === $this->ident;
578+
$case_insensitive = method_exists( $processor, 'is_quirks_mode' ) && $processor->is_quirks_mode();
579+
return $case_insensitive ?
580+
0 === strcasecmp( $processor->get_attribute( 'id' ), $this->ident ) :
581+
$processor->get_attribute( 'id' ) === $this->ident;
580582
}
581583
}
582584

0 commit comments

Comments
 (0)