diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-07-16 18:41:30 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-07-16 18:41:30 +0200 |
commit | b61ac43abecafdd4e9597022fe8b09323854aac9 (patch) | |
tree | f3a030258babf4f767af85e9fe95562c32accdab /phpBB/includes/functions_user.php | |
parent | f5bb145040a483a76fd734bb9d4025c54e7917a0 (diff) | |
download | forums-b61ac43abecafdd4e9597022fe8b09323854aac9.tar forums-b61ac43abecafdd4e9597022fe8b09323854aac9.tar.gz forums-b61ac43abecafdd4e9597022fe8b09323854aac9.tar.bz2 forums-b61ac43abecafdd4e9597022fe8b09323854aac9.tar.xz forums-b61ac43abecafdd4e9597022fe8b09323854aac9.zip |
[feature/new-tz-handling] Allow phpbb prefix for user data validation functions
PHPBB3-9558
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index f235b2be55..27f4b60189 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1248,10 +1248,21 @@ function validate_data($data, $val_ary) $function = array_shift($validate); array_unshift($validate, $data[$var]); - if ($result = call_user_func_array('validate_' . $function, $validate)) + if (function_exists('phpbb_validate_' . $function)) { - // Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted. - $error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var); + if ($result = call_user_func_array('phpbb_validate_' . $function, $validate)) + { + // Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted. + $error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var); + } + } + else + { + if ($result = call_user_func_array('validate_' . $function, $validate)) + { + // Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted. + $error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var); + } } } } @@ -1407,7 +1418,7 @@ function validate_language_iso_name($lang_iso) * a string which will be used as the error message * (with the variable name appended) */ -function validate_timezone($timezone) +function phpbb_validate_timezone($timezone) { return (in_array($timezone, DateTimeZone::listIdentifiers())) ? false : 'TIMEZONE_INVALID'; } |