Infinite loop in YITH_WCAN_Navigation_Widget::get_link_attributes
-
Hi there,
There is a potential infinte loop (happened to me multiple times) in
yith-woocommerce-ajax-navigation/includes/widgets/class-yith-wcan-navigation-widget.php
YITH_WCAN_Navigation_Widget::get_link_attributes
Lines: 651-654
while ( $in_array_function( $term->slug, $data['terms'] ) ) { $key = array_search( $current_term, $data ); // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict unset( $data['terms'][ $key ] ); }
There are instances when $key is false which results in an infinate loop in the while cycle because $data[‘terms’][ $key ] cannot be unset (resulting in php timeout – http status 500).
I also think that this
$key = array_search( $current_term, $data );
should actually be
$key = array_search( $current_term, $data['terms'] );
for the code to work properly, but I haven’t investigated deeper.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Infinite loop in YITH_WCAN_Navigation_Widget::get_link_attributes’ is closed to new replies.