Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Email Class - setAttachmentCID return value uses undefinded index #4813

Closed
dirkbez opened this issue Jun 10, 2021 · 1 comment
Closed
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@dirkbez
Copy link

dirkbez commented Jun 10, 2021

Method setAttachmentCID( $filename ) crashes as the return value is not set.

line 763 : return $attachment['cid'];

The array index is not set and cause an exception:
"title": "ErrorException", "type": "ErrorException", "code": 500, "message": "Undefined index: cid"

CodeIgniter 4 version
First encountered in version 4.1.2 seems to still be there in 4.1.3

Affected module(s)
System/Email/Email.php

On my local version I changed the affected line (761) to:

$attachment['cid'] = $this->attachments[ $i ][ 'cid' ] = uniqid( basename( $attachment[ 'name' ][ 0 ] ) . '@', TRUE );

@dirkbez dirkbez added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 10, 2021
@paulbalandan
Copy link
Member

This has been fixed by #4798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants