mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03: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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$aDispParamList = $aDispList[1];
|
$aDispParamList = $aDispList[1];
|
||||||
if (\is_array($aDispParamList))
|
if (\is_array($aDispParamList))
|
||||||
{
|
{
|
||||||
$aDispositionParams = self::getKeyValueListFromArrayList($aDispParamList);
|
$aDispositionParams = self::getKeyValueListFromArrayList($aDispParamList);
|
||||||
$sFileName = self::decodeAttrParameter($aDispositionParams, 'filename', $sCharset ?: '');
|
$sFileName = self::decodeAttrParameter($aDispositionParams, 'filename', $sCharset ?: '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
++$iExtraItemPos;
|
++$iExtraItemPos;
|
||||||
|
|
||||||
$sLanguage = null;
|
$sLanguage = null;
|
||||||
if ($iExtraItemPos < count($aBodyStructure))
|
if ($iExtraItemPos < \count($aBodyStructure))
|
||||||
{
|
{
|
||||||
if (null !== $aBodyStructure[$iExtraItemPos] && 'NIL' !== $aBodyStructure[$iExtraItemPos])
|
if (null !== $aBodyStructure[$iExtraItemPos] && 'NIL' !== $aBodyStructure[$iExtraItemPos])
|
||||||
{
|
{
|
||||||
|
|
@ -778,9 +778,10 @@ class BodyStructure
|
||||||
private static function getKeyValueListFromArrayList(array $aList) : array
|
private static function getKeyValueListFromArrayList(array $aList) : array
|
||||||
{
|
{
|
||||||
$aDict = 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]))
|
if (\is_string($aList[$iIndex]) && isset($aList[$iIndex + 1]) && \is_string($aList[$iIndex + 1]))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue