File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ protected static function fromBodyStructure($structure)
38
38
39
39
return (object ) [
40
40
'type ' => 0 ,
41
- 'encoding ' => self ::$ encodingNumber [ $ structure[ 5 ]] ?? 0 ,
41
+ 'encoding ' => self ::getEncoding ( $ structure, 5 ) ,
42
42
'ifsubtype ' => 1 ,
43
43
'subtype ' => $ structure [1 ],
44
44
'ifdescription ' => 0 ,
@@ -122,7 +122,7 @@ protected static function extractPart($item)
122
122
123
123
$ part = (object ) [
124
124
'type ' => $ type ,
125
- 'encoding ' => is_numeric ( $ item [ 5 ]) ? ( self ::$ encodingNumber [ $ item[ 5 ]] ?? 0 ) : 0 ,
125
+ 'encoding ' => self ::getEncoding ( $ item, 5 ) ,
126
126
'ifsubtype ' => 1 ,
127
127
'subtype ' => $ item [1 ],
128
128
'ifdescription ' => 0 ,
@@ -215,15 +215,17 @@ protected static function processSubPartAsMessage($item)
215
215
216
216
$ part = (object ) [
217
217
'type ' => 0 ,
218
- 'encoding ' => 0 ,
218
+ 'encoding ' => self :: getEncoding ( $ itemPart , 5 ) ,
219
219
'ifsubtype ' => 1 ,
220
220
'subtype ' => 'PLAIN ' ,
221
221
'ifdescription ' => 0 ,
222
222
'ifid ' => 0 ,
223
- 'lines ' => 1 ,
224
- 'bytes ' => 9 ,
223
+ 'lines ' => intval ( $ itemPart [ 7 ]) ,
224
+ 'bytes ' => intval ( $ itemPart [ 6 ]) ,
225
225
'ifdisposition ' => 0 ,
226
+ 'disposition ' => [],
226
227
'ifdparameters ' => 0 ,
228
+ 'dparameters ' => [],
227
229
'ifparameters ' => 1 ,
228
230
'parameters ' => $ parameters
229
231
];
@@ -285,4 +287,9 @@ protected static function extractParameters($attributes, $parameters)
285
287
286
288
return $ parameters ;
287
289
}
290
+
291
+ protected static function getEncoding ($ item , $ encodingIndex )
292
+ {
293
+ return isset ($ item [$ encodingIndex ]) ? (self ::$ encodingNumber [$ item [$ encodingIndex ]] ?? 0 ) : 0 ;
294
+ }
288
295
}
You can’t perform that action at this time.
0 commit comments