diff options
Diffstat (limited to 'phpBB/adm/index.php')
-rw-r--r-- | phpBB/adm/index.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 92bcf90039..68508bc353 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -237,7 +237,7 @@ function build_select($option_ary, $option_default = false) /** * Build radio fields in acp pages */ -function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = false) +function h_radio($name, $input_ary, $input_default = false, $id = false, $key = false, $separator = '') { global $user; @@ -246,7 +246,7 @@ function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = foreach ($input_ary as $value => $title) { $selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : ''; - $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>'; + $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>' . $separator; $id_assigned = true; } @@ -276,7 +276,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $size = (int) $tpl_type[1]; $maxlength = (int) $tpl_type[2]; - $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '" />'; + $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '"' . (($tpl_type[0] === 'password') ? ' autocomplete="off"' : '') . ' />'; break; case 'dimension': @@ -573,7 +573,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), |