Line 750 starts with
$return = ($hook = get_hook('ps_do_bbcode_start')) ? eval($hook) : null;
if ($return !== null)
return $return;
The whole section of code looks like this...
//
// Convert BBCodes to their HTML equivalent
//
function do_bbcode($text, $is_signature = false)
{
global $lang_common, $forum_user, $forum_config;
$return = ($hook = get_hook('ps_do_bbcode_start')) ? eval($hook) : null;
if ($return !== null)
return $return;
if (strpos($text, '[quote') !== false)
{
$text = preg_replace_callback(
'#\[quote=(&\#039;|"|"|\'|)(.*?)\\1\]#', function($matches) {
global $lang_common;
return '</p><div class="quotebox"><cite>'.str_replace(array('[', '"'), array('[', '"'), $matches[2])." ".$lang_common['wrote'].":</cite><blockquote><p>";
},
$text);
$text = preg_replace('#\[quote\]\s*#', '</p><div class="quotebox"><blockquote><p>', $text);
$text = preg_replace('#\s*\[\/quote\]#S', '</p></blockquote></div><p>', $text);
}
if (!$is_signature)
{
$pattern_callback[] = '%\[list(?:=([1a*]))?+\]((?:(?>.*?(?=\[list(?:=[1a*])?+\]|\[/list\]))|(?R))*)\[/list\]%is';
$replace_callback[] = 'handle_list_tag($matches[2], $matches[1])';
}
$pattern[] = '#\[b\](.*?)\[/b\]#ms';
$pattern[] = '#\[i\](.*?)\[/i\]#ms';
$pattern[] = '#\[u\](.*?)\[/u\]#ms';
$pattern[] = '#\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]#ms';
$pattern[] = '#\[h\](.*?)\[/h\]#ms';
$replace[] = '<strong>$matches[1]</strong>';
$replace[] = '<em>$matches[1]</em>';
$replace[] = '<span class=\"bbu\">$matches[1]</span>';
$replace[] = '<span style=\"color: $matches[1]\">$matches[2]</span>';
$replace[] = '</p><h5>$matches[1]</h5><p>';
if (($is_signature && $forum_config['p_sig_img_tag'] == '1') || (!$is_signature && $forum_config['p_message_img_tag'] == '1'))
{
$pattern[] = '#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#';
$pattern[] = '#\[img=([^\[]*?)\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#';
if ($is_signature)
{
$replace[] = '".handle_img_tag($matches[1].$matches[3], true)."';
$replace[] = '".handle_img_tag($matches[2].$matches[4], true, $matches[1])."';
}
else
{
$replace[] = '".handle_img_tag($matches[1].$matches[3], false)."';
$replace[] = '".handle_img_tag($matches[2].$matches[4], false, $matches[1])."';
}
}
$text = preg_replace_callback('#\[url\]([^\[]*?)\[/url\]#', 'callback_handle_url_nobb', $text);
$text = preg_replace_callback('#\[url=([^\[]+?)\](.*?)\[/url\]#', 'callback_handle_url_nobb', $text);
$pattern[] = '#\[email\]([^\[]*?)\[/email\]#';
$pattern[] = '#\[email=([^\[]+?)\](.*?)\[/email\]#';
$replace[] = '<a href=\"mailto:$matches[1]\">$matches[1]</a>';
$replace[] = '<a href=\"mailto:$matches[1]\">$matches[2]</a>';
$return = ($hook = get_hook('ps_do_bbcode_replace')) ? eval($hook) : null;
if ($return !== null)
return $return;
$count = count($pattern);
for ($i = 0; $i < $count; $i++) {
$text = preg_replace_callback($pattern[$i], function($matches) use ($replace, $i) {
return eval('return "'.$replace[$i].'";');
}, $text);
}
$count = count($pattern_callback);
for ($i = 0; $i < $count; $i++) {
$text = preg_replace_callback($pattern_callback[$i], function($matches) use ($replace_callback, $i) {
return eval('return '.$replace_callback[$i].';');
}, $text);
}
$return = ($hook = get_hook('ps_do_bbcode_end')) ? eval($hook) : null;
if ($return !== null)
return $return;
return $text;
}