File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ protected function parse(){
166
166
$ body = $ this ->raw ;
167
167
}
168
168
169
- $ this ->subtype = $ this ->parseSubtype ($ this ->header ->get ("content-type " ));
170
169
$ this ->parseDisposition ();
171
170
$ this ->parseDescription ();
172
171
$ this ->parseEncoding ();
@@ -186,10 +185,15 @@ protected function parse(){
186
185
]);
187
186
}
188
187
189
- if (!empty ($ this ->header ->get ("content-type " ))){
190
- $ rawContentType = $ this ->header ->get ("content-type " );
191
- $ contentTypeArray = explode ('; ' , $ rawContentType );
192
- $ this ->content_type = trim ($ contentTypeArray [0 ]);
188
+ $ content_types = $ this ->header ->get ("content-type " );
189
+ if (!empty ($ content_types )){
190
+ $ this ->subtype = $ this ->parseSubtype ($ content_types );
191
+ $ content_type = $ content_types ;
192
+ if (is_array ($ content_types )) {
193
+ $ content_type = $ content_types [0 ];
194
+ }
195
+ $ parts = explode ('; ' , $ content_type );
196
+ $ this ->content_type = trim ($ parts [0 ]);
193
197
}
194
198
195
199
You can’t perform that action at this time.
0 commit comments