From 7ae5432fbfc0e923f2fe8dc62ff77afb8ecc80cf Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 30 May 2012 04:42:27 -0400
Subject: [PATCH] Abbreviate long attachment file names with ellipsis (#1488499)
---
program/include/rcube_sqlite.inc | 84 +++++++++++++++++++++++-------------------
1 files changed, 46 insertions(+), 38 deletions(-)
diff --git a/program/include/rcube_sqlite.inc b/program/include/rcube_sqlite.inc
index 78c671d..3b74b26 100644
--- a/program/include/rcube_sqlite.inc
+++ b/program/include/rcube_sqlite.inc
@@ -4,9 +4,12 @@
+-----------------------------------------------------------------------+
| program/include/rcube_sqlite.inc |
| |
- | This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
+ | This file is part of the Roundcube Webmail client |
+ | Copyright (C) 2005-2010, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
| |
| PURPOSE: |
| Provide callback functions for sqlite that will emulate |
@@ -20,52 +23,57 @@
*/
+/**
+ * Callback functions for sqlite database interface
+ *
+ * @package Database
+ */
+
function rcube_sqlite_from_unixtime($timestamp)
- {
- $timestamp = trim($timestamp);
- if (!preg_match("/^[0-9]+$/is", $timestamp))
- $ret = strtotime($timestamp);
- else
- $ret = $timestamp;
-
- $ret = date("Y-m-d H:i:s", $ret);
- rcube_sqlite_debug("FROM_UNIXTIME ($timestamp) = $ret");
- return $ret;
- }
+{
+ $timestamp = trim($timestamp);
+ if (!preg_match('/^[0-9]+$/is', $timestamp))
+ $ret = strtotime($timestamp);
+ else
+ $ret = $timestamp;
+
+ $ret = date('Y-m-d H:i:s', $ret);
+ rcube_sqlite_debug("FROM_UNIXTIME ($timestamp) = $ret");
+ return $ret;
+}
-function rcube_sqlite_unix_timestamp($timestamp="")
- {
- $timestamp = trim($timestamp);
- if (!$timestamp)
- $ret = time();
- else if (!preg_match("/^[0-9]+$/is", $timestamp))
- $ret = strtotime($timestamp);
- else
- $ret = $timestamp;
+function rcube_sqlite_unix_timestamp($timestamp='')
+{
+ $timestamp = trim($timestamp);
+ if (!$timestamp)
+ $ret = time();
+ else if (!preg_match('/^[0-9]+$/is', $timestamp))
+ $ret = strtotime($timestamp);
+ else
+ $ret = $timestamp;
- rcube_sqlite_debug("UNIX_TIMESTAMP ($timestamp) = $ret");
- return $ret;
- }
+ rcube_sqlite_debug("UNIX_TIMESTAMP ($timestamp) = $ret");
+ return $ret;
+}
function rcube_sqlite_now()
- {
- rcube_sqlite_debug("NOW() = ".date("Y-m-d H:i:s"));
- return date("Y-m-d H:i:s");
- }
+{
+ rcube_sqlite_debug("NOW() = ".date("Y-m-d H:i:s"));
+ return date("Y-m-d H:i:s");
+}
function rcube_sqlite_md5($str)
- {
- return md5($str);
- }
+{
+ return md5($str);
+}
function rcube_sqlite_debug($str)
- {
- //console($str);
- }
-
-?>
\ No newline at end of file
+{
+ //console($str);
+}
+
--
Gitblit v1.9.1