• 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.

    • This topic was modified 9 months, 2 weeks ago by marinkiss.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,

    thank you for contacting us.

    I added a check to prevent error if $key is false, you’ll find it in the next official release of the plugin.

    Thanks for your great cooperation.

    prashantajani

    (@prashantajani)

    Please let me know if this issue is resolved.

    I have updated plugin to version 4.32.0 and it’s taking too much CPU time due to time out of at file – \yith-woocommerce-ajax-navigation\includes\widgets\class-yith-wcan-navigation-widget.php – line 651

    Please let me know update

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.