File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
lib/classes/Swift/Transport Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class Swift_Transport_Esmtp_AuthHandler implements Swift_Transport_EsmtpHandler
3939 /**
4040 * The auth mode for authentication.
4141 *
42- * @var string
42+ * @var string|null
4343 */
4444 private $ _auth_mode ;
4545
@@ -248,7 +248,7 @@ public function resetState()
248248 */
249249 protected function _getAuthenticatorsForAgent ()
250250 {
251- if (!$ mode = strtolower ($ this ->_auth_mode )) {
251+ if (!$ this -> _auth_mode || ! $ mode = strtolower ($ this ->_auth_mode )) {
252252 return $ this ->_authenticators ;
253253 }
254254
Original file line number Diff line number Diff line change @@ -134,18 +134,18 @@ public function getTimeout()
134134 /**
135135 * Set the encryption type (tls or ssl).
136136 *
137- * @param string $encryption
137+ * @param string|null $encryption
138138 *
139139 * @return $this
140140 */
141141 public function setEncryption ($ encryption )
142142 {
143- $ encryption = strtolower ($ encryption );
144- if ('tls ' == $ encryption ) {
143+ $ normalizedEncryption = $ encryption ? strtolower ($ encryption ) : '' ;
144+ if ('tls ' === $ normalizedEncryption ) {
145145 $ this ->_params ['protocol ' ] = 'tcp ' ;
146146 $ this ->_params ['tls ' ] = true ;
147147 } else {
148- $ this ->_params ['protocol ' ] = $ encryption ;
148+ $ this ->_params ['protocol ' ] = $ normalizedEncryption ;
149149 $ this ->_params ['tls ' ] = false ;
150150 }
151151
You can’t perform that action at this time.
0 commit comments