include_once(BASEDIR.'includes/geshi/geshi.php'); preg_match_all("#\[code=(.*?)\](.*?)\[/code\]#si",$text,$matches,PREG_PATTERN_ORDER); for($i=0; $i','',str_replace('
','', str_replace('
', '', stripslashes($matches[2][$i])))); //replace problematic characters $search = array(""", "'", "\", """, "'", "<", ">", "&"); $replace = array("\"", "'", "\\", "\"", "\'", "<", ">", "&"); $input = str_replace($search,$replace, $input); $geshi = new GeSHi($input, $matches[1][$i]); $geshi->set_header_type(GESHI_HEADER_PRE); $geshi -> enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); $text=preg_replace("#\[code=(.*?)\](.*?)\[/code\]#si",'$2',$text); $text=str_replace($matches[2][$i], "
".$geshi->get_language_name()."
".html_entity_decode($geshi->parse_code())."
", $text); }