1

Topic: Bug in pun_include

PunBB does not check that the pun_include statement is inside brackets. If you leave out the brackets, the loop will continue indefinitely. In footer.php, line 143, I suggest you change the code from

while (preg_match('<pun_include "(.*?)">', $tpl_main, $cur_include))
{ 
        ob_start();
        include PUN_ROOT.$cur_include[1];
        $tpl_temp = ob_get_contents();
        $tpl_main = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_main);
    ob_end_clean();
}

to

while (preg_match('/<pun_include "(.*?)">/', $tpl_main, $cur_include))
{ 
        ob_start();
        include PUN_ROOT.$cur_include[1];
        $tpl_temp = ob_get_contents();
        $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
    ob_end_clean();
}

I hope I didn't get it wrong now again wink

Re: Bug in pun_include

You're absolutely right this time smile I had no idea < and > were valid delimiters. That's probably why I never noticed the error. Thanks for the report.

"Programming is like sex: one mistake and you have to support it for the rest of your life."