Fix bug where microsecond format in logged date didn't work in some cases

pull/5268/merge
Aleksander Machniak 9 years ago
parent 5e1277e971
commit f2eafda539

@ -30,6 +30,7 @@ CHANGELOG Roundcube Webmail
- Workaround PHP issue by calling closelog() on script shutdown when using log_driver=syslog (#5289)
- Fix so upgrade script makes sure program/lib directory does not contain old libraries (#5287)
- Fix subscription checkbox state on error in folder subscribe/unsubscribe action (#5243)
- Fix bug where microsecond format in logged date didn't work in some cases
RELEASE 1.2.0
-------------

@ -1208,11 +1208,14 @@ class rcube_utils
$format = 'd-M-Y H:i:s O';
}
if (strpos($format, 'u') !== false
&& ($date = date_create_from_format('U.u.e', microtime(true) . '.' . date_default_timezone_get()))
) {
if (strpos($format, 'u') !== false) {
$dt = number_format(microtime(true), 6, '.', '');
$dt .= '.' . date_default_timezone_get();
if ($date = date_create_from_format('U.u.e', $dt)) {
return $date->format($format);
}
}
return date($format);
}

Loading…
Cancel
Save