From 1c2963ab54956d8b61f094966d67e5d2ac4b255a Mon Sep 17 00:00:00 2001 From: pdontthink Date: Fri, 23 Jan 2009 20:42:43 +0000 Subject: [PATCH] Add typecast type for bigint git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13398 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/global.php | 3 +++ include/constants.php | 1 + 2 files changed, 4 insertions(+) diff --git a/functions/global.php b/functions/global.php index 36ee51a5..c56411e5 100644 --- a/functions/global.php +++ b/functions/global.php @@ -340,6 +340,9 @@ function sqgetGlobalVar($name, &$value, $search = SQ_INORDER, $default = NULL, $ case SQ_TYPE_INT: $value = (int) $value; break; case SQ_TYPE_STRING: $value = (string) $value; break; case SQ_TYPE_BOOL: $value = (bool) $value; break; + case SQ_TYPE_BIGINT: + $value = (preg_match('/^[0-9]+$/', $value) ? $value : '0'); + break; default: break; } } else if (!$result && !is_null($default)) { diff --git a/include/constants.php b/include/constants.php index 1fd2cd04..bf649187 100644 --- a/include/constants.php +++ b/include/constants.php @@ -197,6 +197,7 @@ define('SM_ABOOK_FIELD_LABEL', 4); * @since 1.5.2 */ define('SQ_TYPE_INT', 'int'); +define('SQ_TYPE_BIGINT', 'bigint'); define('SQ_TYPE_STRING', 'string'); define('SQ_TYPE_BOOL', 'bool'); define('SQ_TYPE_ARRAY', 'array'); -- 2.25.1