mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-25 18:51:42 +02:00
Fix mail (#621)
This commit is contained in:
@@ -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(
|
||||||
|
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user