Fix intenaldate parser

This commit is contained in:
RainLoop Team 2014-07-31 00:57:41 +04:00
parent 1de1ecc9c4
commit 7dc9441852
12 changed files with 199 additions and 184 deletions

View file

@ -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;
}

View file

@ -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', '');