File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
16
16
- Syntax updated to support php 8 features
17
17
- Get the attachment file extension from the filename if no mimetype detection library is available
18
18
- Prevent the structure parsing from parsing an empty part
19
+ - Convert all header keys to their lower case representation
19
20
20
21
### Added
21
22
- Unit tests added #347 #242 (thanks @sergiy-petrov , @boekkooi-lengoo )
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ public function rfc822_parse_headers($raw_headers): object {
216
216
if (extension_loaded ('imap ' ) && $ this ->config ["rfc822 " ]) {
217
217
$ raw_imap_headers = (array )\imap_rfc822_parse_headers ($ raw_headers );
218
218
foreach ($ raw_imap_headers as $ key => $ values ) {
219
- $ key = str_replace ("- " , "_ " , $ key );
219
+ $ key = strtolower ( str_replace ("- " , "_ " , $ key) );
220
220
$ imap_headers [$ key ] = $ values ;
221
221
}
222
222
}
@@ -249,7 +249,7 @@ public function rfc822_parse_headers($raw_headers): object {
249
249
} else {
250
250
if (($ pos = strpos ($ line , ": " )) > 0 ) {
251
251
$ key = trim (rtrim (strtolower (substr ($ line , 0 , $ pos ))));
252
- $ key = str_replace ("- " , "_ " , $ key );
252
+ $ key = strtolower ( str_replace ("- " , "_ " , $ key) );
253
253
254
254
$ value = trim (rtrim (substr ($ line , $ pos + 1 )));
255
255
if (isset ($ headers [$ key ])) {
You can’t perform that action at this time.
0 commit comments