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

pull/5754/head
Aleksander Machniak 9 years ago
parent 92df79b37b
commit b1217807f3

@ -19,6 +19,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,10 +1208,13 @@ 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()))
) {
return $date->format($format);
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