Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
b1b69f72
Commit
b1b69f72
authored
Feb 27, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2207021
by Berdir: Remove legacy PHP 5.3 code from PhpMail plugin.
parent
7d985d59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php
core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php
+12
-25
No files found.
core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php
View file @
b1b69f72
...
...
@@ -55,8 +55,7 @@ public function format(array $message) {
public
function
mail
(
array
$message
)
{
// If 'Return-Path' isn't already set in php.ini, we pass it separately
// as an additional parameter instead of in the header.
// However, if PHP's 'safe_mode' is on, this is not allowed.
if
(
isset
(
$message
[
'headers'
][
'Return-Path'
])
&&
!
ini_get
(
'safe_mode'
))
{
if
(
isset
(
$message
[
'headers'
][
'Return-Path'
]))
{
$return_path_set
=
strpos
(
ini_get
(
'sendmail_path'
),
' -f'
);
if
(
!
$return_path_set
)
{
$message
[
'Return-Path'
]
=
$message
[
'headers'
][
'Return-Path'
];
...
...
@@ -85,29 +84,17 @@ public function mail(array $message) {
// hosts. The return value of this method will still indicate whether mail
// was sent successfully.
if
(
!
$request
->
server
->
has
(
'WINDIR'
)
&&
strpos
(
$request
->
server
->
get
(
'SERVER_SOFTWARE'
),
'Win32'
)
===
FALSE
)
{
if
(
isset
(
$message
[
'Return-Path'
])
&&
!
ini_get
(
'safe_mode'
))
{
// On most non-Windows systems, the "-f" option to the sendmail command
// is used to set the Return-Path. There is no space between -f and
// the value of the return path.
$mail_result
=
@
mail
(
$message
[
'to'
],
$mail_subject
,
$mail_body
,
$mail_headers
,
'-f'
.
$message
[
'Return-Path'
]
);
}
else
{
// The optional $additional_parameters argument to mail() is not
// allowed if safe_mode is enabled. Passing any value throws a PHP
// warning and makes mail() return FALSE.
$mail_result
=
@
mail
(
$message
[
'to'
],
$mail_subject
,
$mail_body
,
$mail_headers
);
}
// On most non-Windows systems, the "-f" option to the sendmail command
// is used to set the Return-Path. There is no space between -f and
// the value of the return path.
$additional_headers
=
isset
(
$message
[
'Return-Path'
])
?
'-f'
.
$message
[
'Return-Path'
]
:
''
;
$mail_result
=
@
mail
(
$message
[
'to'
],
$mail_subject
,
$mail_body
,
$mail_headers
,
$additional_headers
);
}
else
{
// On Windows, PHP will use the value of sendmail_from for the
...
...
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