cleanup
This commit is contained in:
parent
9f6c762c18
commit
7097c008e2
|
@ -215,35 +215,30 @@ $purifier = new HTMLPurifier($purifier_config);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="mt-2 card-text">
|
<div class="mt-2 card-text">
|
||||||
<div>
|
<?php
|
||||||
<?php
|
$safeHtml = $purifier->purify($email->textHtml);
|
||||||
$safeHtml = $purifier->purify($email->textHtml);
|
|
||||||
|
|
||||||
$safeText = $purifier->purify($email->textPlain);
|
$safeText = $purifier->purify($email->textPlain);
|
||||||
$safeText = nl2br($safeText);
|
$safeText = nl2br($safeText);
|
||||||
$safeText = \AutoLinkExtension::auto_link_text($safeText);
|
$safeText = \AutoLinkExtension::auto_link_text($safeText);
|
||||||
|
|
||||||
$hasHtml = strlen(trim($safeHtml)) > 0;
|
$hasHtml = strlen(trim($safeHtml)) > 0;
|
||||||
$hasText = strlen(trim($safeText)) > 0;
|
$hasText = strlen(trim($safeText)) > 0;
|
||||||
|
|
||||||
if ($config['prefer_plaintext']) {
|
if ($config['prefer_plaintext']) {
|
||||||
if ($hasText) {
|
if ($hasText) {
|
||||||
echo $safeText;
|
echo $safeText;
|
||||||
} else {
|
|
||||||
echo $safeHtml;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if ($hasHtml) {
|
echo $safeHtml;
|
||||||
echo $safeHtml;
|
|
||||||
} else {
|
|
||||||
echo $safeText;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
} else {
|
||||||
</div>
|
if ($hasHtml) {
|
||||||
<div>
|
echo $safeHtml;
|
||||||
<?php ?>
|
} else {
|
||||||
</div>
|
echo $safeText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user