-
Notifications
You must be signed in to change notification settings - Fork 460
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
Making into disposition string to lowercase to fix the comparision issue #566
base: master
Are you sure you want to change the base?
Conversation
@ambrous this change seems to break something. Please rebase and solve this issue. Otherwise I'll close this pull request in the future. |
@Sebi94nbg , I've rebased. However, I don't know how to recheck again by codeclimate. |
@bapcltd-marv I'm kinda unsure about this change. Does it make sense to you? Would you merge it? |
I think it is useful fix as sometime attachments are lost due to the low case of the disposition. |
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.
Sorry, forgot to publish my review. 😞
@@ -1249,9 +1249,9 @@ public function getMail(int $mailId, bool $markAsSeen = true): IncomingMail | |||
* | |||
* @return IncomingMailAttachment $attachment | |||
*/ | |||
public function downloadAttachment(DataPartInfo $dataInfo, array $params, object $partStructure, bool $emlOrigin = false): IncomingMailAttachment | |||
public function downloadAttachment(DataPartInfo $dataInfo, array $params, object $partStructure, bool $emlOrigin = false, bool $dispositionAttachment = false): IncomingMailAttachment |
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.
You are adding a new argument here and set it by default to false
, but it seems like as it's never used, so it's always false
. Isn't it?
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.
No, please see the whole changed function not only my changes.
{ | ||
if ('RFC822' == $partStructure->subtype && isset($partStructure->disposition) && 'attachment' == $partStructure->disposition) { | ||
if ('RFC822' == $partStructure->subtype && isset($partStructure->disposition) && $dispositionAttachment) { |
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'm still not sure, if this is a good replacement. I think, this will break (also) something.
Before: string comparisation
After: boolean comparisation
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.
This function skipped attachments in some emails due to case sensitive comparison.
I've just put almost the same comparison (but now it is not case sensitive) in one place and then use the boolean replacement of it, kind of some refactoring)
Hi!
I faced an issue that in some cases field disposition comes in upper case and due to that comparisions of
'attachment' == $partStructure->disposition
faild. It seems that it happens with outlook attachments.Also, I'm not sure that is was a good idea to add an additional param to function of downloadAttachment, but I suppose it looks a bit more clear.