Skip to content

Commit 9099f86

Browse files
committed
fix: use is_resource() instead of null check for SMTP connection validation
1 parent 3aeabec commit 9099f86

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

system/Email/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2227,7 +2227,7 @@ protected function mimeTypes($ext = '')
22272227

22282228
public function __destruct()
22292229
{
2230-
if ($this->SMTPConnect !== null) {
2230+
if (is_resource($this->SMTPConnect)) {
22312231
try {
22322232
$this->sendCommand('quit');
22332233
} catch (ErrorException $e) {

user_guide_src/source/changelogs/v4.6.3.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Bugs Fixed
3131
**********
3232

3333
- **Email:** Fixed a bug with CID check when building email attachments.
34+
- **Email:** Fixed SMTP connection resource validation in the class destructor.
3435

3536
See the repo's
3637
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_

0 commit comments

Comments
 (0)