$body = trim($purifier->purify($body)); $encode = isset($result['TEXT']) ? 'TEXT' : 'HTML'; } else { $encode = 'HTML'; $body = '<p class="text-center text-muted">Preview unavailable</p>'; } } $javascript[] = 'static/js/preview.js'; $javascript[] = 'static/js/diff_match_patch.js'; $javascript[] = 'static/js/diff.js'; require_once BASE . '/inc/smarty.php'; if ($settings->getDisplayTextlog() && $node && $mail->msgid) { $smarty->assign('support_log', true); } if ($settings->getDisplayScores()) { $smarty->assign('scores', history_parse_scores($mail)); } if ($node) { $smarty->assign('node', $node->getId()); } if ($attachments) { $smarty->assign('attachments', $attachments); } if (isset($body)) { $smarty->assign('body', $body); } if ($encode) { $smarty->assign('encode', $encode); } if ($_GET['type'] == 'text') { $smarty->assign('show_text', true);
$mail['mail'] = $m['data']; $mail['type'] = $m['type']; $mail['node'] = $m['id']; if ($m['data']->msgts0 + 3600 * 24 > time()) { $mail['today'] = true; } $mail['time'] = $m['data']->msgts0 - $_SESSION['timezone'] * 60; $mail['preview'] = $preview; $mail['tr'] = $tr; $mail['td'] = $td; $mail['action_icon'] = $action_icons[$m['data']->msgaction]; $mail['action_color'] = $action_colors[$m['data']->msgaction]; $mail['description'] = $m['data']->msgerror ?: $m['data']->msgdescription; if ($settings->getDisplayScores()) { $printscores = array(); $scores = history_parse_scores($m['data']); foreach ($scores as $engine => $s) { if ($engine == 'rpd' && $s['score'] != 'Unknown') { $printscores[] = strtolower($s['score']); } if ($engine == 'kav' && $s['score'] != 'Ok') { $printscores[] = 'virus'; } if ($engine == 'clam' && $s['score'] != 'Ok') { $printscores[] = 'virus'; } if ($engine == 'rpdav' && $s['score'] != 'Ok') { $printscores[] = 'virus'; } if ($engine == 'sa') { $printscores[] = $s['score'];