• Hey!

    Just a friendly developer reviewing the code here πŸ™‚

    I think I found a recursion issue (I’ll be honest, I haven’t installed it just yet). It looks like you have some code in place to prevent the same shortcode from running, but I don’t see anything in place for preventing multi-step recursion. Also, I think the code that’s there would fail to save it after rendering a different sub-shortcode.

    More specifically, here’s the code I’m seeing:

            // Prevent same shortcode nested loop
    if( self::$current_shortcode == $shortcode[ 'name' ] ){
    return '';
    }
    self::$current_shortcode = $shortcode[ 'name' ];

    ...

    self::$current_shortcode = false;

    return $sc_content;

    You probably actually want to make self::$current_shortcode an array that you push to/pop from, and then do an in_array() check, rather than using a single value. Otherwise, if shortcode A contains B, and shortcode B contains A, this wouldn’t catch the recursion. The = false here also fails to restore the previous value. So, if shortcode A contains shortcode B followed by shortcode A, self::$current_shortcode is false by the time the nested A is reached.

    Thanks for your work though! I’ll probably install this soon! (Albeit, I’ll just be careful with recursive shortcodes πŸ˜‰ )

    • This topic was modified 2 days, 1 hour ago by codesmith32.
    • This topic was modified 2 days, 1 hour ago by codesmith32.

You must be logged in to reply to this topic.