aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/index.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2011-02-04 00:08:35 +0100
committerAndreas Fischer <bantu@phpbb.com>2011-02-04 00:08:35 +0100
commit4aafe4b42239101b81d9216f552e00ad911ee25c (patch)
treefc36a7ec98408cfdc2e725d5ca2a4c98bf3fe0c4 /phpBB/adm/index.php
parent270a0020abe3272a0925cdfdc2977cfe13eb0a49 (diff)
parent181f2551cfc82e119d73f462268813d18de06097 (diff)
downloadforums-4aafe4b42239101b81d9216f552e00ad911ee25c.tar
forums-4aafe4b42239101b81d9216f552e00ad911ee25c.tar.gz
forums-4aafe4b42239101b81d9216f552e00ad911ee25c.tar.bz2
forums-4aafe4b42239101b81d9216f552e00ad911ee25c.tar.xz
forums-4aafe4b42239101b81d9216f552e00ad911ee25c.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/10020] Fix 32-bit php braindamage around INT_MIN. [ticket/10020] Replaced (int) 0x80000000 with portable equivalent.
Diffstat (limited to 'phpBB/adm/index.php')
-rw-r--r--phpBB/adm/index.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index c4037d05bf..ce5012ba29 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -574,7 +574,11 @@ function validate_range($value_ary, &$error)
'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1),
'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535),
'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff),
- 'INT' => array('php_type' => 'int', 'min' => (int) 0x80000000, 'max' => (int) 0x7fffffff),
+ // Do not use (int) 0x80000000 - it evaluates to different
+ // values on 32-bit and 64-bit systems.
+ // Apparently -2147483648 is a float on 32-bit systems,
+ // despite fitting in an int, thus explicit cast is needed.
+ 'INT' => array('php_type' => 'int', 'min' => (int) -2147483648, 'max' => (int) 0x7fffffff),
'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127),
'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255),