Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
f82519b1
Commit
f82519b1
authored
Sep 22, 2014
by
Nikola Kovacs
Committed by
Qiang Xue
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use text/plain part of multipart message for text body and charset in debug mail panel.
Fixes #5126
parent
3697682a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
CHANGELOG.md
extensions/debug/CHANGELOG.md
+1
-0
MailPanel.php
extensions/debug/panels/MailPanel.php
+16
-1
No files found.
extensions/debug/CHANGELOG.md
View file @
f82519b1
...
...
@@ -7,6 +7,7 @@ Yii Framework 2 debug extension Change Log
-
Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
-
Bug #3956: Debug toolbar was affecting flash message removal (samdark)
-
Bug #4812: Fixed search filter (samdark)
-
Bug #5126: Fixed text body and charset not being set for multipart mail (nkovacs)
-
Enh #2299: Date and time in request list is now never wrapped (samdark)
-
Enh #3088: The debug module will manage their own URL rules now (qiangxue)
-
Enh #3103: debugger panel is now not displayed when printing a page (githubjeka)
...
...
extensions/debug/panels/MailPanel.php
View file @
f82519b1
...
...
@@ -62,7 +62,22 @@ class MailPanel extends Panel
/* @var $swiftMessage \Swift_Message */
$swiftMessage
=
$message
->
getSwiftMessage
();
$messageData
[
'body'
]
=
$swiftMessage
->
getBody
();
$body
=
$swiftMessage
->
getBody
();
if
(
empty
(
$body
))
{
$parts
=
$swiftMessage
->
getChildren
();
foreach
(
$parts
as
$part
)
{
if
(
!
(
$part
instanceof
\Swift_Mime_Attachment
))
{
/* @var $part \Swift_Mime_MimePart */
if
(
$part
->
getContentType
()
==
'text/plain'
)
{
$messageData
[
'charset'
]
=
$part
->
getCharset
();
$body
=
$part
->
getBody
();
break
;
}
}
}
}
$messageData
[
'body'
]
=
$body
;
$messageData
[
'time'
]
=
$swiftMessage
->
getDate
();
$messageData
[
'headers'
]
=
$swiftMessage
->
getHeaders
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment