mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 14:37:02 +03:00
Fix intenaldate parser
This commit is contained in:
parent
1de1ecc9c4
commit
7dc9441852
12 changed files with 199 additions and 184 deletions
|
|
@ -55,7 +55,13 @@ class DateTimeHelper
|
|||
*/
|
||||
public static function ParseInternalDateString($sDateTime)
|
||||
{
|
||||
$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', \trim($sDateTime), \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
|
||||
$sDateTime = \trim($sDateTime);
|
||||
if (\preg_match('/^[a-z]{2,4}, /i', $sDateTime)) // RFC2822
|
||||
{
|
||||
return \MailSo\Base\DateTimeHelper::ParseRFC2822DateString($sDateTime);
|
||||
}
|
||||
|
||||
$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', $sDateTime, \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
|
||||
return $oDateTime ? $oDateTime->getTimestamp() : 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1800,7 +1800,7 @@ class Actions
|
|||
$oItem->SetReplyTo(isset($aItem['ReplyTo']) ? $aItem['ReplyTo'] : '');
|
||||
$oItem->SetBcc(isset($aItem['Bcc']) ? $aItem['Bcc'] : '');
|
||||
$oItem->SetSignature(isset($aItem['Signature']) ? $aItem['Signature'] : '');
|
||||
|
||||
|
||||
if ('' !== $oItem->Id())
|
||||
{
|
||||
\array_push($aIdentities, $oItem);
|
||||
|
|
@ -5829,7 +5829,7 @@ class Actions
|
|||
|
||||
return $this->DefaultResponse(__FUNCTION__, $mResult);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -5838,7 +5838,7 @@ class Actions
|
|||
$oAccount = $this->getAccountFromToken();
|
||||
|
||||
$mResult = false;
|
||||
|
||||
|
||||
$sUrl = $this->GetActionParam('Url', '');
|
||||
$sAccessToken = $this->GetActionParam('AccessToken', '');
|
||||
$sGoogleApiKey = (string) $this->Config()->Get('social', 'google_api_key', '');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue