Add typecast type for bigint
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 23 Jan 2009 20:42:43 +0000 (20:42 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 23 Jan 2009 20:42:43 +0000 (20:42 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13398 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/global.php
include/constants.php

index 36ee51a58011f14d01512ac8177b22f0adfd712b..c56411e5d51bcc101b3a52a5593abb021c8f24e2 100644 (file)
@@ -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)) {
index 1fd2cd0400018e0702f550e9ee4aede045b9d7fc..bf6491871a9121fb13faa46f29ccda76d8efe433 100644 (file)
@@ -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');