Skip to content

Commit

Permalink
[TASK] Drop redundant condition from TransportFactory
Browse files Browse the repository at this point in the history
The variable `$port` in the changed code is an array element
from the return value of `GeneralUtility::trimExplode()` with
the `$removeEmptyValues` argument set to `true`. Hence it
is ensured to not be an empty string.

This change should be backported as it otherwise would block
improvements for the type annotations of
`GeneralUtility::trimExplode()`.

Resolves: #101384
Releases: main, 12.4, 11.5
Change-Id: I74ce433495fc3975c11991d21831db0244eacba0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80085
Tested-by: Alexander Schnitzler <git@alexanderschnitzler.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan B�rk <stefan@buerk.tech>
Reviewed-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Alexander Schnitzler <git@alexanderschnitzler.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
oliverklee authored and lolli42 committed Jul 19, 2023
1 parent fa9c3d0 commit 0a8d164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Mail/TransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function get(array $mailSettings): TransportInterface
if ($host === '') {
throw new Exception('$GLOBALS[\'TYPO3_CONF_VARS\'][\'MAIL\'][\'transport_smtp_server\'] needs to be set when transport is set to "smtp".', 1291068606);
}
if ($port === null || $port === '') {
if ($port === null) {
$port = 25;
} else {
$port = (int)$port;
Expand Down

0 comments on commit 0a8d164

Please sign in to comment.