Skip to content

Commit add1a03

Browse files
committed
Message attribute is now case insensitive
1 parent ec1cf60 commit add1a03

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
66

77
## [UNRELEASED]
88

9+
## [1.0.2.8] - 2017-06-25
10+
### Added
11+
-Message attribute is now case insensitive
12+
-Readme file extended
13+
-Changelog typo fixed
14+
15+
### Affected Classes
16+
\Webklex\IMAP\Message
17+
18+
919
## [1.0.2.7] - 2017-04-23
1020
### Added
1121
-imap_fetchheader(): Bad message number - merged
1222
-Changed the default options in imap_fetchbody function - merged
1323
-Attachment handling fixed (Plain text files are no longer ignored)
1424
-Optional config parameter added.
15-
-Readme file extened
25+
-Readme file extended
1626

1727
### Changes
1828
\Webklex\IMAP\Client
@@ -24,7 +34,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
2434
### Added
2535
-Code commented
2636
-A whole bunch of functions and features added. To many to mention all of them ;)
27-
-Readme file extened
37+
-Readme file extended
2838

2939
### Changes
3040
\Webklex\IMAP\Client

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ You can define your accounts inside the `config/imap.php` file:
133133
```
134134

135135
## Documentation
136-
### \Webklex\IMAP\Client
136+
### [Client::class](src/IMAP/Client.php)
137137
| Method | Arguments | Return | Description |
138138
| --------------------- | ------------------------------------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------- |
139139
| setConfig | array $config | self | Set the Client configuration. Take a look at `config/imap.php` for more inspiration. |
@@ -157,7 +157,7 @@ You can define your accounts inside the `config/imap.php` file:
157157
| expunge | | bool | Delete all messages marked for deletion |
158158
| checkCurrentMailbox | | object | Check current mailbox |
159159

160-
### \Webklex\IMAP\Message
160+
### [Message::class](src/IMAP/Message.php)
161161
| Method | Arguments | Return | Description |
162162
| -------------- | ----------------------------- | :---------: | -------------------------------------- |
163163
| delete | | | Delete the current Message |
@@ -171,7 +171,7 @@ You can define your accounts inside the `config/imap.php` file:
171171
| getHTMLBody | | string | Get the Message html body |
172172
| getAttachments | | collection | Get all message attachments |
173173

174-
### \Webklex\IMAP\Folder
174+
### [Folder::class](src/IMAP/Folder.php)
175175
| Method | Arguments | Return | Description |
176176
| ------------- | ------------------------------------------------------- | :-----: | ---------------------------------------------- |
177177
| hasChildren | | bool | Determine if folder has children. |

src/IMAP/Message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ protected function fetchAttachment($structure, $partNumber){
411411
$attachment->name = false;
412412
if (property_exists($structure, 'dparameters')) {
413413
foreach ($structure->dparameters as $parameter) {
414-
if ($parameter->attribute == "filename") {
414+
if (strtolower($parameter->attribute) == "filename") {
415415
$attachment->name = $parameter->value;
416416
break;
417417
}
@@ -420,7 +420,7 @@ protected function fetchAttachment($structure, $partNumber){
420420

421421
if (!$attachment->name && property_exists($structure, 'parameters')) {
422422
foreach ($structure->parameters as $parameter) {
423-
if ($parameter->attribute == "name") {
423+
if (strtolower($parameter->attribute) == "name") {
424424
$attachment->name = $parameter->value;
425425
break;
426426
}
@@ -495,7 +495,7 @@ private function convertEncoding($str, $from = "ISO-8859-2", $to = "UTF-8") {
495495
private function getEncoding($structure) {
496496
if (property_exists($structure, 'parameters')) {
497497
foreach ($structure->parameters as $parameter) {
498-
if ($parameter->attribute == "charset") {
498+
if (strtolower($parameter->attribute) == "charset") {
499499
return strtoupper($parameter->value);
500500
}
501501
}

0 commit comments

Comments
 (0)