50 static $schemeCache = [];
61 $logEntryFields = $cache[
$logId];
70 'select' => [
'ID',
'TITLE',
'MESSAGE',
'PARAMS' ]
73 $logEntryFields = $res->fetch();
74 $cache[
$logId] = $logEntryFields;
77 if (empty($logEntryFields))
82 $entryParams = unserialize($logEntryFields[
'PARAMS'], [
'allowed_classes' =>
false ]);
85 !is_array($entryParams)
86 && !empty($logEntryFields[
'PARAMS'])
89 $tmp = explode(
"&", $logEntryFields[
'PARAMS']);
90 if (is_array($tmp) && count($tmp) > 0)
92 $entryParams = array();
93 foreach($tmp as $pair)
95 [$key, $value] = explode(
"=", $pair);
96 $entryParams[$key] = $value;
102 $logEntryFields[
'SCHEME_FIELDS'] = [];
104 $schemeId = (is_array($entryParams) && isset($entryParams[
'SCHEME_ID']) ? (int)$entryParams[
'SCHEME_ID'] : 0);
108 if (isset($schemeCache[$schemeId]))
110 $schemeFields = $schemeCache[$schemeId];
112 elseif (Loader::includeModule(
'xdimport'))
114 $res = \CXDILFScheme::getById($schemeId);
115 $schemeFields = $res->fetch();
116 $schemeCache[$schemeId] = $schemeFields;
119 $logEntryFields[
'SCHEME_FIELDS'] = $schemeFields;
122 $this->
setLogId($logEntryFields[
'ID']);
127 !empty($logEntryFields[
'SCHEME_FIELDS'])
128 && isset($logEntryFields[
'SCHEME_FIELDS'][
'IS_HTML'])
131 $html = ($logEntryFields[
'SCHEME_FIELDS'][
'IS_HTML'] ===
"Y");
136 $description = htmlspecialcharsback($logEntryFields[
'MESSAGE']);
137 $sanitizer = new \CBXSanitizer();
138 $sanitizer->applyDoubleEncode(
false);
139 $sanitizer->setLevel(\CBXSanitizer::SECURE_LEVEL_LOW);
182 if (empty($this->sourceFields))
188 if (empty($logEntryFields))
196 !empty($logEntryFields[
'SCHEME_FIELDS'])
197 && isset($logEntryFields[
'SCHEME_FIELDS'][
'IS_HTML'])
200 $html = ($logEntryFields[
'SCHEME_FIELDS'][
'IS_HTML'] ===
"Y");
205 $result = htmlspecialcharsback($logEntryFields[
'MESSAGE']);
206 $result = truncateText(\CTextParser::clearAllTags($result), 100);
210 $result = truncateText(htmlspecialcharsEx($logEntryFields[
'MESSAGE']), 100);