mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
Bugfix: Trying to access array offset on value of type null
Now that the ResponseParser is fixed and handles NIL the BodyStructure class bug was detected
This commit is contained in:
parent
40b8bf3d7e
commit
a6ebee8e13
1 changed files with 10 additions and 9 deletions
|
@ -680,20 +680,20 @@ class BodyStructure
|
|||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$aDispParamList = $aDispList[1];
|
||||
if (\is_array($aDispParamList))
|
||||
{
|
||||
$aDispositionParams = self::getKeyValueListFromArrayList($aDispParamList);
|
||||
$sFileName = self::decodeAttrParameter($aDispositionParams, 'filename', $sCharset ?: '');
|
||||
$aDispParamList = $aDispList[1];
|
||||
if (\is_array($aDispParamList))
|
||||
{
|
||||
$aDispositionParams = self::getKeyValueListFromArrayList($aDispParamList);
|
||||
$sFileName = self::decodeAttrParameter($aDispositionParams, 'filename', $sCharset ?: '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
++$iExtraItemPos;
|
||||
|
||||
$sLanguage = null;
|
||||
if ($iExtraItemPos < count($aBodyStructure))
|
||||
if ($iExtraItemPos < \count($aBodyStructure))
|
||||
{
|
||||
if (null !== $aBodyStructure[$iExtraItemPos] && 'NIL' !== $aBodyStructure[$iExtraItemPos])
|
||||
{
|
||||
|
@ -778,9 +778,10 @@ class BodyStructure
|
|||
private static function getKeyValueListFromArrayList(array $aList) : array
|
||||
{
|
||||
$aDict = array();
|
||||
if (0 === \count($aList) % 2)
|
||||
$iLen = \count($aList);
|
||||
if (0 === ($iLen % 2))
|
||||
{
|
||||
for ($iIndex = 0, $iLen = \count($aList); $iIndex < $iLen; $iIndex += 2)
|
||||
for ($iIndex = 0; $iIndex < $iLen; $iIndex += 2)
|
||||
{
|
||||
if (\is_string($aList[$iIndex]) && isset($aList[$iIndex + 1]) && \is_string($aList[$iIndex + 1]))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue