Skip to content

Commit

Permalink
Fix out-of-bounds string index warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Mar 12, 2024
1 parent 50f88fc commit 3a2a072
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ private function data_wp_bind_processor( WP_Interactivity_API_Directives_Process
$attribute_value = $p->get_attribute( $attribute_name );
$result = $this->evaluate( $attribute_value, end( $namespace_stack ), end( $context_stack ) );

if ( null !== $result && ( false !== $result || '-' === $bound_attribute[4] ) ) {
if ( null !== $result && (
false !== $result ||
( strlen( $bound_attribute ) > 5 && '-' === $bound_attribute[4] )
) ) {
/*
* If the result of the evaluation is a boolean and the attribute is
* `aria-` or `data-, convert it to a string "true" or "false". It
Expand Down

0 comments on commit 3a2a072

Please sign in to comment.