aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2010-09-16 13:04:12 +0200
committerJoas Schilling <nickvergessen@gmx.de>2011-02-01 13:38:44 +0100
commit737849bc23dc8081a82f00c78247e824b6a42daf (patch)
treeb703716ca4e1051a8db95e95fffe46163badda21 /phpBB/includes/functions_acp.php
parent[ticket/9823] Unit tests for build_cfg_template. (diff)
downloadphpbb-737849bc23dc8081a82f00c78247e824b6a42daf.tar.gz
phpbb-737849bc23dc8081a82f00c78247e824b6a42daf.tar.bz2
phpbb-737849bc23dc8081a82f00c78247e824b6a42daf.zip
[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
Diffstat (limited to 'phpBB/includes/functions_acp.php')
-rw-r--r--phpBB/includes/functions_acp.php4
1 files changed, 2 insertions, 2 deletions
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]);
}