File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,15 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
7
7
## [ UNRELEASED]
8
8
### Fixed
9
9
- Text/Html body fetched as attachment if subtype is null #34
10
+ - Potential header overwriting through header extensions #35
10
11
11
12
### Added
12
13
- NaN
13
14
14
15
### Affected Classes
15
16
- [ Message::class] ( src/Message.php )
16
17
- [ Part::class] ( src/Part.php )
18
+ - [ Header::class] ( src/Header.php )
17
19
18
20
### Breaking changes
19
21
- NaN
Original file line number Diff line number Diff line change @@ -528,9 +528,15 @@ private function extractHeaderExtensions(){
528
528
foreach ($ extensions as $ extension ) {
529
529
if (($ pos = strpos ($ extension , "= " )) !== false ){
530
530
$ key = substr ($ extension , 0 , $ pos );
531
- $ value = substr ($ extension , $ pos + 1 );
532
- $ value = str_replace ('" ' , "" , $ value );
533
- $ this ->attributes [trim (rtrim (strtolower ($ key )))] = trim (rtrim ($ value ));
531
+ $ key = trim (rtrim (strtolower ($ key )));
532
+
533
+ if (isset ($ this ->attributes [$ key ]) === false ) {
534
+ $ value = substr ($ extension , $ pos + 1 );
535
+ $ value = str_replace ('" ' , "" , $ value );
536
+ $ value = trim (rtrim ($ value ));
537
+
538
+ $ this ->attributes [$ key ] = $ value ;
539
+ }
534
540
}
535
541
}
536
542
}
You can’t perform that action at this time.
0 commit comments