34 $config = parent::loadConfig(__DIR__);
35 if (empty(
$config[
'highlight'])) {
36 return "<pre>{$source}</pre>";
39 $source = stripslashes($source);
40 if (
$config[
'highlight'] ==
'geshi') {
60 if (!strpos(
$text,
"<?php") and (substr(
$text, 0, 5) !=
"<?php")) {
65 if (!strpos(
$text,
"?>")) {
69 $oldlevel = error_reporting(0);
75 $buffer = highlight_string(
$text,
true);
78 $buffer = str_replace(
"XxxX",
"\\", $buffer);
80 error_reporting($oldlevel);
81 $pos_open = $pos_close = 0;
83 $pos_open = strpos($buffer,
'<?php ');
85 if ($addedtag_close) {
86 $pos_close = strrpos($buffer,
'?>');
89 $str_open = ($addedtag_open) ? substr($buffer, 0, $pos_open) :
"";
90 $str_close = ($pos_close) ? substr($buffer, $pos_close + 5) :
"";
92 $length_open = ($addedtag_open) ? $pos_open + 14 : 0;
93 $length_text = ($pos_close) ? $pos_close - $length_open : 0;
94 $str_internal = ($length_text) ? substr($buffer, $length_open, $length_text) : substr($buffer, $length_open);
96 $buffer = $str_open . $str_internal . $str_close;
113 $geshi =
new XoopsGeshi($source,
$language);
116 $geshi->set_header_type(GESHI_HEADER_NONE);
121 $geshi->set_link_target(
"_blank");
124 $code = $geshi->parse_code();
load(MyTextSanitizer &$ts, $source, $language)
static load($name, $type="core")
geshi($source, $language)
undoHtmlSpecialChars($text)