1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 18:51:42 +02:00
This commit is contained in:
erikn69
2024-03-13 01:03:00 -05:00
committed by GitHub
parent e0c2f962c1
commit 2330df1dca
2 changed files with 8 additions and 3 deletions

View File

@@ -43,13 +43,15 @@ class SwiftMailCollector extends DataCollector implements Renderable, AssetProvi
{ {
$mails = array(); $mails = array();
foreach ($this->messagesLogger->getMessages() as $msg) { foreach ($this->messagesLogger->getMessages() as $msg) {
$html = $this->showBody ? $msg->getBody() : null; $body = $this->showBody ? $msg->getBody() : null;
$isHtml = strpos((string) $msg->getHeaders()->get('Content-Type'), 'html') !== false;
$mails[] = array( $mails[] = array(
'to' => $this->formatTo($msg->getTo()), 'to' => $this->formatTo($msg->getTo()),
'subject' => $msg->getSubject(), 'subject' => $msg->getSubject(),
'headers' => $msg->getHeaders()->toString(), 'headers' => $msg->getHeaders()->toString(),
'body' => $html, 'body' => !$isHtml ? $body : null,
'html' => null, 'html' => $isHtml ? $body : null,
); );
} }
return array( return array(

View File

@@ -43,6 +43,9 @@
var headers = $('<pre />').addClass(csscls('headers')).appendTo(li); var headers = $('<pre />').addClass(csscls('headers')).appendTo(li);
$('<code />').text(mail.headers).appendTo(headers); $('<code />').text(mail.headers).appendTo(headers);
li.click(function() { li.click(function() {
if (window.getSelection().type == "Range") {
return''
}
if (headers.is(':visible')) { if (headers.is(':visible')) {
headers.hide(); headers.hide();
} else { } else {