Skip to content

Commit 5638156

Browse files
swissspidyclaude
andcommitted
Avoid a possibly missing match offset in the class attribute check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 5f8ea49 commit 5638156

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/Block_Search_Command.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ private function matches_style_filter( array $block, $style_name ) {
936936
}
937937

938938
foreach ( $class_attributes as $class_attribute ) {
939-
$classes = $class_attribute[1] . ( isset( $class_attribute[2] ) ? $class_attribute[2] : '' );
939+
$classes = isset( $class_attribute[2] ) ? $class_attribute[2] : ( isset( $class_attribute[1] ) ? $class_attribute[1] : '' );
940940

941941
if ( 1 === preg_match( '/(^|\s)' . preg_quote( $needle, '/' ) . '(\s|$)/', $classes ) ) {
942942
return true;

0 commit comments

Comments
 (0)