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
adcf7888
Commit
adcf7888
authored
Dec 06, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1446: infinite loop may occur when using EmailTarget and there's missing…
Fixes #1446: infinite loop may occur when using EmailTarget and there's missing message translation.
parent
a0b9aedb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
EmailTarget.php
framework/yii/log/EmailTarget.php
+5
-3
No files found.
framework/yii/log/EmailTarget.php
View file @
adcf7888
...
@@ -43,9 +43,6 @@ class EmailTarget extends Target
...
@@ -43,9 +43,6 @@ class EmailTarget extends Target
if
(
empty
(
$this
->
message
[
'to'
]))
{
if
(
empty
(
$this
->
message
[
'to'
]))
{
throw
new
InvalidConfigException
(
'The "to" option must be set for EmailTarget::message.'
);
throw
new
InvalidConfigException
(
'The "to" option must be set for EmailTarget::message.'
);
}
}
if
(
empty
(
$this
->
message
[
'subject'
]))
{
$this
->
message
[
'subject'
]
=
Yii
::
t
(
'yii'
,
'Application Log'
);
}
if
(
is_string
(
$this
->
mail
))
{
if
(
is_string
(
$this
->
mail
))
{
$this
->
mail
=
Yii
::
$app
->
getComponent
(
$this
->
mail
);
$this
->
mail
=
Yii
::
$app
->
getComponent
(
$this
->
mail
);
}
}
...
@@ -59,6 +56,11 @@ class EmailTarget extends Target
...
@@ -59,6 +56,11 @@ class EmailTarget extends Target
*/
*/
public
function
export
()
public
function
export
()
{
{
// moved initialization of subject here because of the following issue
// https://github.com/yiisoft/yii2/issues/1446
if
(
empty
(
$this
->
message
[
'subject'
]))
{
$this
->
message
[
'subject'
]
=
Yii
::
t
(
'yii'
,
'Application Log'
);
}
$messages
=
array_map
([
$this
,
'formatMessage'
],
$this
->
messages
);
$messages
=
array_map
([
$this
,
'formatMessage'
],
$this
->
messages
);
$body
=
wordwrap
(
implode
(
"
\n
"
,
$messages
),
70
);
$body
=
wordwrap
(
implode
(
"
\n
"
,
$messages
),
70
);
$this
->
composeMessage
(
$body
)
->
send
(
$this
->
mail
);
$this
->
composeMessage
(
$body
)
->
send
(
$this
->
mail
);
...
...
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