Skip to content

Commit

Permalink
Attachment detection updated #82 #90
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Jan 19, 2021
1 parent 22a33f4 commit de50ce3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip

## [UNRELEASED]
### Fixed
- Attachment detection updated #82 #90
- Timeout handling improved

### Added
- Auto reconnect option added to `Folder::idle()` #89

### Affected Classes
- [Folder::class](src/Folder.php)
- [Part::class](src/Part.php)
- [Client::class](src/Client.php)

### Breaking changes
Expand Down
7 changes: 2 additions & 5 deletions src/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,8 @@ private function parseEncoding(){
* @return bool
*/
public function isAttachment(){
if ($this->type == IMAP::MESSAGE_TYPE_TEXT &&
($this->ifdisposition == 0 ||
(empty($this->disposition) || !in_array(strtolower($this->disposition), ClientManager::get('options.dispositions')))
)
) {
$valid_disposition = in_array(strtolower($this->disposition), ClientManager::get('options.dispositions'));
if ($this->type == IMAP::MESSAGE_TYPE_TEXT && ($this->ifdisposition == 0 || (empty($this->disposition))) && !$valid_disposition) {
if (($this->subtype == null || in_array((strtolower($this->subtype)), ["plain", "csv", "html"])) && $this->filename == null && $this->name == null) {
return false;
}
Expand Down

0 comments on commit de50ce3

Please sign in to comment.