Fix html2text for MSG_NO_ATTACHMENT and signatures w/special chars
This commit is contained in:
parent
c5cc934483
commit
727f9432e9
@ -122,7 +122,9 @@ if (strlen($message)) {
|
||||
// Attach signature to the message?
|
||||
if (!$submit_as_customer && !empty($_POST['signature'])) {
|
||||
if ($modsForHesk_settings['rich_text_for_tickets']) {
|
||||
$message .= "<br><br>" . nl2br($_SESSION['signature']) . "<br>";
|
||||
$signature = nl2br($_SESSION['signature']);
|
||||
$signature = hesk_htmlspecialchars($signature);
|
||||
$message .= "<br><br>" . $signature . "<br>";
|
||||
} else {
|
||||
$message .= "\n\n" . addslashes($_SESSION['signature']) . "\n";
|
||||
}
|
||||
|
@ -804,7 +804,16 @@ function hesk_processMessage($msg, $ticket, $is_admin, $is_ticket, $just_message
|
||||
$htmlMessage = nl2br($ticket['message']);
|
||||
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%', $htmlMessage, $msg);
|
||||
} else {
|
||||
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%', $ticket['message'], $msg);
|
||||
$plainTextMessage = $ticket['message'];
|
||||
$message_has_html = checkForHtml($ticket);
|
||||
if ($message_has_html) {
|
||||
if (!function_exists('convert_html_to_text')) {
|
||||
require(HESK_PATH . 'inc/html2text/html2text.php');
|
||||
}
|
||||
$plainTextMessage = convert_html_to_text($plainTextMessage);
|
||||
$plainTextMessage = fix_newlines($plainTextMessage);
|
||||
}
|
||||
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%', $plainTextMessage, $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user