From 737849bc23dc8081a82f00c78247e824b6a42daf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 16 Sep 2010 13:04:12 +0200 Subject: [ticket/9823] Unit tests for validate_config_vars. Fix some documentations and use the $max-var instead of the magic-number in validate_config_vars. PHPBB3-9823 --- phpBB/includes/functions_acp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_acp.php') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 40b92db1f5..af419c4288 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -300,7 +300,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) } /** -* Going through a config array and validate values, writing errors to $error. The validation method accepts parameters separated by ':' for string and int. +* Going through a config array and validate values, writing errors to $error. The validation method accepts parameters separated by ':' for string and int. * The first parameter defines the type to be used, the second the lower bound and the third the upper bound. Only the type is required. */ function validate_config_vars($config_vars, &$cfg_array, &$error) @@ -337,7 +337,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) { $error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]); } - else if (isset($validator[$max]) && $length > $validator[2]) + else if (isset($validator[$max]) && $length > $validator[$max]) { $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]); } -- cgit v1.2.3-65-gdbad