Fix unexpected desktop mode on mobile devices + small fixes (#1514)

This commit is contained in:
RainLoop 2017-09-24 19:14:48 +03:00
parent 677a5f2e35
commit ed5685314e
10 changed files with 115 additions and 88 deletions

View file

@ -67,7 +67,10 @@ class SubStreams
$sHashName = \MailSo\Base\Utils::Md5Rand();
self::$aStreams[$sHashName] = $aSubStreams;
self::$aStreams[$sHashName] = array_map(function($mItem) {
return \is_resource($mItem) ? $mItem :
\MailSo\Base\ResourceRegistry::CreateMemoryResourceFromString($mItem);
}, $aSubStreams);
\MailSo\Base\Loader::IncStatistic('CreateStream/SubStreams');
@ -181,26 +184,6 @@ class SubStreams
$this->iIndex++;
}
}
else if (\is_string($mCurrentPart))
{
$sReadResult = \substr($mCurrentPart, 0, $iCount);
$sReturn .= $sReadResult;
$iLen = \strlen($sReadResult);
if ($iCount < $iLen)
{
$this->sBuffer = \substr($sReturn, $iCount);
$sReturn = \substr($sReturn, 0, $iCount);
$iCount = 0;
}
else
{
$iCount -= $iLen;
}
$this->iIndex++;
}
}
}