-
Notifications
You must be signed in to change notification settings - Fork 460
Adding support to keep original Filename of Attachment and open more flexibility #645
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
682b25d
9f6ff93
282cbca
08ebd52
40253ce
bd1c98e
2b998b9
46cfc29
35df2e3
82547df
b5fcde5
8f9d27a
e866a8a
02d9347
37d2d03
44cddfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -156,9 +156,10 @@ class Mailbox | |||||||||||||||
/** @var string */ | ||||||||||||||||
protected $mailboxFolder; | ||||||||||||||||
|
||||||||||||||||
/** @var bool|false */ | ||||||||||||||||
protected $attachmentFilenameMode = false; | ||||||||||||||||
|
||||||||||||||||
public const ATTACH_FILE_NAMERANDOM = 1; // Filename is unique (random) | ||||||||||||||||
public const ATTACH_FILE_NAMEORIGINAL = 2; // Filename is Attachment-Filename | ||||||||||||||||
/** @var int */ | ||||||||||||||||
protected $attachmentsFilenameMode = self::ATTACH_FILE_NAMERANDOM; | ||||||||||||||||
|
protected $attachmentsFilenameMode = self::ATTACH_FILE_NAMERANDOM; | |
protected $attachmentsFilenameMode = self::ATTACH_FILE_NAMERANDOM; | |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable in the comment should match the actual parameter variable.
* @param int $random ATTACH_FILE_NAMERANDOM, ATTACH_FILE_NAMEORIGINAL | |
* @param int $mode ATTACH_FILE_NAMERANDOM, ATTACH_FILE_NAMEORIGINAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I miss a check here, which ensures, that only supported modes can be set. Something like this:
$this->attachmentsFilenameMode = $mode; | |
if (!defined($mode)) | |
{ | |
throw new UnexpectedValueException("The defined mode '$mode' is not supported. Supported modes: ATTACH_FILE_NAMERANDOM, ATTACH_FILE_NAMEORIGINAL"); | |
} | |
$this->attachmentsFilenameMode = $mode; |
Note: I haven't tested this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this return here? Wouldn't be a void
function enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.