From 0f0f136dd2481cef76c1365458c866533d89f868 Mon Sep 17 00:00:00 2001 From: Nick Sagona Date: Mon, 19 Dec 2022 16:45:27 -0600 Subject: [PATCH] Patch for v8 str func issues --- src/Transport/Smtp/AuthHandler.php | 6 +++--- src/Transport/Smtp/EsmtpTransport.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Transport/Smtp/AuthHandler.php b/src/Transport/Smtp/AuthHandler.php index 072c9f9..aceb43f 100644 --- a/src/Transport/Smtp/AuthHandler.php +++ b/src/Transport/Smtp/AuthHandler.php @@ -175,7 +175,7 @@ public function afterEhlo(AgentInterface $agent) if ($this->username) { $count = 0; foreach ($this->getAuthenticatorsForAgent() as $authenticator) { - if (in_array(strtolower($authenticator->getAuthKeyword()), + if (in_array(strtolower((string)$authenticator->getAuthKeyword()), array_map('strtolower', $this->esmtpParams))) { ++$count; if ($authenticator->authenticate($agent, $this->username, $this->password)) { @@ -246,12 +246,12 @@ public function resetState() */ protected function getAuthenticatorsForAgent() { - if (!$mode = strtolower($this->authMode)) { + if (!$mode = strtolower((string)$this->authMode)) { return $this->authenticators; } foreach ($this->authenticators as $authenticator) { - if (strtolower($authenticator->getAuthKeyword()) == $mode) { + if (strtolower((string)$authenticator->getAuthKeyword()) == $mode) { return [$authenticator]; } } diff --git a/src/Transport/Smtp/EsmtpTransport.php b/src/Transport/Smtp/EsmtpTransport.php index 8f5e310..b5454cb 100644 --- a/src/Transport/Smtp/EsmtpTransport.php +++ b/src/Transport/Smtp/EsmtpTransport.php @@ -152,7 +152,7 @@ public function getTimeout() */ public function setEncryption($encryption) { - $encryption = strtolower($encryption); + $encryption = strtolower((string)$encryption); if ('tls' == $encryption) { $this->params['protocol'] = 'tcp'; $this->params['tls'] = true; @@ -289,7 +289,7 @@ public function __call($method, $args) if (method_exists($handler, $method)) { $return = call_user_func_array([$handler, $method], $args); // Allow fluid method calls - if (is_null($return) && substr(strtolower($method), 0, 3) == 'set') { + if (is_null($return) && substr(strtolower((string)$method), 0, 3) == 'set') { return $this; } else { return $return;