1 (edited by dimkalinux 2009-12-24 08:33)

Topic: Bug in pun_bbcode

If i use in my own extension hook pun_bbcode_pre_tags_merge than after this array $ext_info empty and not code bellow this hook in bar.php not working because use $ext_info.

bar.php from latest pun_bbcode

($hook = get_hook('pun_bbcode_pre_tags_merge')) ? eval($hook) : null;

    // Let's get the list of all tags
    $tags = array_unique(array_merge($tags_without_attr, $tags_with_attr));

//// NOT WORKING - $ext_info['path'] is unset.

    if ($forum_user['pun_bbcode_use_buttons'])
    {
        if (file_exists($ext_info['path'].'/buttons/'.$forum_user['style'].'/'))
            $buttons_path = $ext_info['url'].'/buttons/'.$forum_user['style'];
        else
            $buttons_path = $ext_info['url'].'/buttons/Oxygen';
    }

Re: Bug in pun_bbcode

The extension system should process extensible extensions correctly. If you open the file "cache_hooks.php" you'll see that some information about an extension is placed into a stack before a hook code of this extension. After the hook the information about a "parent" extension is fetched from the stack. So normally there is no limitation for extensions nesting.

Maybe your extension interfere with the stack somehow and breaks the "$ext_info" variable? Try to reinstall extensions. Also you may send me your extension and I'll try to find out the cause of the bug.

Re: Bug in pun_bbcode

My ext - http://forum.lluga.net/spoiler_bbcode.tar.gz
It`s required this installed before — http://forum.lluga.net/jquery.tar.gz

Re: Bug in pun_bbcode

Wow! It's really a bug. Seems it's in the extension system, not in pun_bbcode. The $ext_info_stack variable doesn't contain the info about pun_bbcode since the hook is in a function and $ext_info_stack is a local variable. I think that we can write $GLOBALS['ext_info_stack'] instead of $ext_info_stack in cache_hooks.php. But this suggestion is to be tested.

Re: Bug in pun_bbcode

I've tried to fix it. Please, download the last revision of PunBB from SVN and test it out. Works fine for me.