- Fix non-RFC dates formatting (#1484901)

release-0.6
alecpl 17 years ago
parent f294da0d9e
commit ea090ca09d

@ -5,6 +5,7 @@ CHANGELOG RoundCube Webmail
---------- ----------
- Fix IMAP response in message body when message has no body (#1484964) - Fix IMAP response in message body when message has no body (#1484964)
- Updated PEAR::Auth_SASL to 1.0.2 - Updated PEAR::Auth_SASL to 1.0.2
- Fix non-RFC dates formatting (#1484901)
2008/04/16 (estadtherr) 2008/04/16 (estadtherr)
---------- ----------

@ -1507,12 +1507,22 @@ function format_date($date, $format=NULL)
global $CONFIG, $sess_user_lang; global $CONFIG, $sess_user_lang;
$ts = NULL; $ts = NULL;
if (is_numeric($date)) if (is_numeric($date))
$ts = $date; $ts = $date;
else if (!empty($date)) else if (!empty($date))
$ts = @strtotime($date); {
while (($ts = @strtotime($date))===false)
{
// if we have a date in non-rfc format
// remove token from the end and try again
$d = explode(' ', $date);
array_pop($d);
if (!$d) break;
$date = implode(' ', $d);
}
}
if (empty($ts)) if (empty($ts))
return ''; return '';

@ -970,7 +970,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
continue; continue;
if ($hkey=='date' && !empty($headers[$hkey])) if ($hkey=='date' && !empty($headers[$hkey]))
$header_value = format_date(strtotime($headers[$hkey])); $header_value = format_date($headers[$hkey]);
else if (in_array($hkey, array('from', 'to', 'cc', 'bcc', 'reply-to'))) else if (in_array($hkey, array('from', 'to', 'cc', 'bcc', 'reply-to')))
$header_value = Q(rcmail_address_string($headers[$hkey], NULL, $attrib['addicon']), 'show'); $header_value = Q(rcmail_address_string($headers[$hkey], NULL, $attrib['addicon']), 'show');
else else
@ -1500,7 +1500,7 @@ function rcmail_send_mdn($uid)
$body = rcube_label("yourmessage") . "\r\n\r\n" . $body = rcube_label("yourmessage") . "\r\n\r\n" .
"\t" . rcube_label("to") . ': ' . rcube_imap::decode_mime_string($message['headers']->to, $message['headers']->charset) . "\r\n" . "\t" . rcube_label("to") . ': ' . rcube_imap::decode_mime_string($message['headers']->to, $message['headers']->charset) . "\r\n" .
"\t" . rcube_label("subject") . ': ' . $message['subject'] . "\r\n" . "\t" . rcube_label("subject") . ': ' . $message['subject'] . "\r\n" .
"\t" . rcube_label("sent") . ': ' . format_date(strtotime($message['headers']->date), $CONFIG['date_long']) . "\r\n" . "\t" . rcube_label("sent") . ': ' . format_date($message['headers']->date, $CONFIG['date_long']) . "\r\n" .
"\r\n" . rcube_label("receiptnote") . "\r\n"; "\r\n" . rcube_label("receiptnote") . "\r\n";
$ua = !empty($CONFIG['useragent']) ? $CONFIG['useragent'] : "RoundCube Webmail (Version ".RCMAIL_VERSION.")"; $ua = !empty($CONFIG['useragent']) ? $CONFIG['useragent'] : "RoundCube Webmail (Version ".RCMAIL_VERSION.")";

Loading…
Cancel
Save