diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 2a29937..086f025 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -496,6 +496,9 @@ function drupal_override_server_variables($variables = array()) {
);
// Replace elements of the $_SERVER array, as appropriate.
$request->server->replace($variables + $server_vars + $defaults);
+
+ // @todo remove once conf_path() no longer uses $_SERVER.
+ $_SERVER = $request->server->all();
}
/**
diff --git a/core/includes/mail.inc b/core/includes/mail.inc
index cb5af1a..dfa3f1d 100644
--- a/core/includes/mail.inc
+++ b/core/includes/mail.inc
@@ -6,13 +6,6 @@
*/
/**
- * Auto-detect appropriate line endings for e-mails.
- *
- * $settings['mail_line_endings'] will override this setting.
- */
-define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE ? "\r\n" : "\n");
-
-/**
* Composes and optionally sends an e-mail message.
*
* Sending an e-mail works with defining an e-mail template (subject, text
@@ -431,7 +424,7 @@ function drupal_html_to_text($string, $allowed_tags = NULL) {
if (isset($casing)) {
$chunk = $casing($chunk);
}
- $line_endings = settings()->get('mail_line_endings', MAIL_LINE_ENDINGS);
+ $line_endings = settings()->get('mail_line_endings', PHP_EOL);
// Format it and apply the current indentation.
$output .= drupal_wrap_mail($chunk, implode('', $indent)) . $line_endings;
// Remove non-quotation markers from indentation.
diff --git a/core/lib/Drupal/Core/Mail/PhpMail.php b/core/lib/Drupal/Core/Mail/PhpMail.php
index d82d770..b7f94bb 100644
--- a/core/lib/Drupal/Core/Mail/PhpMail.php
+++ b/core/lib/Drupal/Core/Mail/PhpMail.php
@@ -59,7 +59,7 @@ public function mail(array $message) {
foreach ($message['headers'] as $name => $value) {
$mimeheaders[] = $name . ': ' . mime_header_encode($value);
}
- $line_endings = settings()->get('mail_line_endings', MAIL_LINE_ENDINGS);
+ $line_endings = settings()->get('mail_line_endings', PHP_EOL);
// Prepare mail commands.
$mail_subject = mime_header_encode($message['subject']);
// Note: e-mail uses CRLF for line-endings. PHP's API requires LF
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php
index 67ee7b6..b2fb336 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php
@@ -8,7 +8,6 @@
namespace Drupal\system\Tests\Bootstrap;
use Drupal\simpletest\UnitTestBase;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpFoundation\Request;
/**
@@ -56,6 +55,7 @@ function testDrupalOverrideServerVariablesProvidedURL() {
drupal_override_server_variables(array('url' => $url));
foreach ($expected_server_values as $key => $value) {
$this->assertIdentical(\Drupal::request()->server->get($key), $value);
+ $this->assertIdentical($_SERVER[$key], $value);
}
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
index f93b40f..751bf0c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
@@ -348,7 +348,7 @@ public function testDrupalHtmlToTextParagraphs() {
public function testVeryLongLineWrap() {
$input = 'Drupal
' . str_repeat('x', 2100) . '>
Drupal';
$output = drupal_html_to_text($input);
- $eol = settings()->get('mail_line_endings', MAIL_LINE_ENDINGS);
+ $eol = settings()->get('mail_line_endings', PHP_EOL);
$maximum_line_length = 0;
foreach (explode($eol, $output) as $line) {