Aleksander Machniak
2015-06-26 9aae1b7fc399b5d2cecb8f0d0df6a2ae4e749786
Fix so microseconds macro (u) in log_date_format works (#1490446)
3 files modified
30 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube.php 6 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_utils.php 23 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -10,6 +10,7 @@
- Plugin API: Added message_ready hook
- Plugin API: Add special onload() method to execute plugin actions before startup (session and GUI initialization)
- Implemented UI element to jump to specified page of the messages list (#1485235)
- Fix so microseconds macro (u) in log_date_format works (#1490446)
- Fix so unrecognized TNEF attachments are displayed on the list of attachments (#1490351)
- Fix "Importing..." message does not hide on error (#1490422)
- Fix Compose action in addressbook for results from multiple addressbooks (#1490413)
program/lib/Roundcube/rcube.php
@@ -1231,11 +1231,7 @@
            $session_key = intval(self::$instance->config->get('log_session_id', 8));
        }
        if (empty($date_format)) {
            $date_format = 'd-M-Y H:i:s O';
        }
        $date = date($date_format);
        $date = rcube_utils::date_format($date_format);
        // trigger logging hook
        if (is_object(self::$instance) && is_object(self::$instance->plugins)) {
program/lib/Roundcube/rcube_utils.php
@@ -1149,4 +1149,27 @@
        return $random;
    }
    /**
     * Format current date according to specified format.
     * This method supports microseconds (u).
     *
     * @param string $format Date format (default: 'd-M-Y H:i:s O')
     *
     * @return string Formatted date
     */
    public static function date_format($format = null)
    {
        if (empty($format)) {
            $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);
        }
        return date($format);
    }
}