Fix bug where some unix timestamps were not handled correctly by rcube_utils::anytodatetime() (#6212)

pull/6465/head
Aleksander Machniak 6 years ago
parent e5b7bcd207
commit f55724d1e8

@ -9,6 +9,7 @@ CHANGELOG Roundcube Webmail
- Fix security issue in remote content blocking on HTML image and style tags (#6178)
- Added 9pt and 11pt to the list of font sizes in HTML editor
- Fix handling encoding of HTML tags in "inline" JSON output (#6207)
- Fix bug where some unix timestamps were not handled correctly by rcube_utils::anytodatetime() (#6212)
RELEASE 1.3.4
-------------

@ -752,7 +752,8 @@ class rcube_utils
// try to parse string with DateTime first
if (!empty($date)) {
try {
$dt = $timezone ? new DateTime($date, $timezone) : new DateTime($date);
$_date = preg_match('/^[0-9]+$/', $date) ? "@$date" : $date;
$dt = $timezone ? new DateTime($_date, $timezone) : new DateTime($_date);
}
catch (Exception $e) {
// ignore

@ -385,6 +385,7 @@ class Framework_Utils extends PHPUnit_Framework_TestCase
'Jan 1st 2014 +0800' => '2013-12-31 18:00', // result in target timezone
'Jan 1st 14 45:42' => '2014-01-01 00:00', // force fallback to rcube_utils::strtotime()
'Jan 1st 2014 UK' => '2014-01-01 00:00',
'1520587800' => '2018-03-09 11:30', // unix timestamp conversion
'Invalid date' => false,
);

Loading…
Cancel
Save