Skip to content

Commit d5d126c

Browse files
authored
Merge pull request #192 from moufmouf/SMTP_option
Fixing broken SMTP option
2 parents 3da8053 + 1f426f0 commit d5d126c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build-and-test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ RESULT=`docker run --rm -e PHP_INI_ERROR_REPORTING="E_ERROR | E_WARNING" thecodi
130130
RESULT=`docker run --rm -e PHP_INI_SESSION__SAVE_PATH="tcp://localhost?auth=yourverycomplex\"passwordhere" thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -i | grep "session.save_path"`
131131
[[ "$RESULT" = "session.save_path => tcp://localhost?auth=yourverycomplex\"passwordhere => tcp://localhost?auth=yourverycomplex\"passwordhere" ]]
132132

133+
# Tests that the SMTP parameter is set in uppercase
134+
RESULT=`docker run --rm -e PHP_INI_SMTP="192.168.0.1" thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -i | grep "^SMTP"`
135+
[[ "$RESULT" = "SMTP => 192.168.0.1 => 192.168.0.1" ]]
136+
133137
# Tests that environment variables are passed to startup scripts when UID is set
134138
RESULT=`docker run --rm -e FOO="bar" -e STARTUP_COMMAND_1="env" -e UID=0 thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} sleep 1 | grep "FOO"`
135139
[[ "$RESULT" = "FOO=bar" ]]

utils/generate_conf.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
foreach ($_SERVER as $key => $value) {
1212
if (strpos($key, 'PHP_INI_') === 0) {
13-
$iniParam = strtolower(substr($key, 8));
13+
$iniParam = substr($key, 8);
14+
if ($iniParam !== 'SMTP') {
15+
// SMTP is the only php.ini parameter that contains uppercase letters (!)
16+
$iniParam = strtolower($iniParam);
17+
}
1418
$iniParam = str_replace('__', '.', $iniParam);
1519
// Let's protect the value if this is a string.
1620
if (!is_numeric($value) && $iniParam !== 'error_reporting') {

0 commit comments

Comments
 (0)