mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Imap ESEARCH helper
This commit is contained in:
parent
576e27ff41
commit
26cd65d763
3 changed files with 166 additions and 6 deletions
|
|
@ -1254,6 +1254,40 @@ class Utils
|
|||
return \MailSo\Base\Utils::Base64Decode($sData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sSequence
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function ExpandFetchSequence($sSequence)
|
||||
{
|
||||
$aResult = array();
|
||||
$sSequence = \trim($sSequence);
|
||||
if (0 < \strlen($sSequence))
|
||||
{
|
||||
$aSequence = \explode(',', $sSequence);
|
||||
foreach ($aSequence as $sItem)
|
||||
{
|
||||
if (false === \strpos($sItem, ':'))
|
||||
{
|
||||
$aResult[] = (int) $sItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aItems = \explode(':', $sItem);
|
||||
$iMax = \max($aItems[0], $aItems[1]);
|
||||
|
||||
for ($iIndex = $aItems[0]; $iIndex <= $iMax; $iIndex++)
|
||||
{
|
||||
$aResult[] = (int) $iIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $aResult;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param resource $fResource
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue