Update AppController.php

Add quotes to MAIL_FROM_NAME when needed
This commit is contained in:
vincentdh 2016-03-26 12:34:39 -04:00
parent aae4f57c09
commit 2c6e9aced3

View File

@ -96,9 +96,15 @@ class AppController extends BaseController
"MAIL_PORT={$mail['port']}\n". "MAIL_PORT={$mail['port']}\n".
"MAIL_ENCRYPTION={$mail['encryption']}\n". "MAIL_ENCRYPTION={$mail['encryption']}\n".
"MAIL_HOST={$mail['host']}\n". "MAIL_HOST={$mail['host']}\n".
"MAIL_USERNAME={$mail['username']}\n". "MAIL_USERNAME={$mail['username']}\n";
"MAIL_FROM_NAME={$mail['from']['name']}\n".
"MAIL_PASSWORD={$mail['password']}\n\n". if (preg_match('/\s/',$mail['from']['name'])) {
$config .= "MAIL_FROM_NAME='{$mail['from']['name']}'\n".
} else {
$config .= "MAIL_FROM_NAME={$mail['from']['name']}\n".
}
$config .= "MAIL_PASSWORD={$mail['password']}\n\n".
"PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address'"; "PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address'";
// Write Config Settings // Write Config Settings
@ -166,6 +172,9 @@ class AppController extends BaseController
$config = ''; $config = '';
foreach ($_ENV as $key => $val) { foreach ($_ENV as $key => $val) {
if (preg_match('/\s/',$val)) {
$val = "'{$val}'";
}
$config .= "{$key}={$val}\n"; $config .= "{$key}={$val}\n";
} }