mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[feature/new-tz-handling] Allow phpbb prefix for user data validation functions
PHPBB3-9558
This commit is contained in:
@@ -1248,10 +1248,21 @@ function validate_data($data, $val_ary)
|
|||||||
$function = array_shift($validate);
|
$function = array_shift($validate);
|
||||||
array_unshift($validate, $data[$var]);
|
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.
|
if ($result = call_user_func_array('phpbb_validate_' . $function, $validate))
|
||||||
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
|
{
|
||||||
|
// 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
|
* a string which will be used as the error message
|
||||||
* (with the variable name appended)
|
* (with the variable name appended)
|
||||||
*/
|
*/
|
||||||
function validate_timezone($timezone)
|
function phpbb_validate_timezone($timezone)
|
||||||
{
|
{
|
||||||
return (in_array($timezone, DateTimeZone::listIdentifiers())) ? false : 'TIMEZONE_INVALID';
|
return (in_array($timezone, DateTimeZone::listIdentifiers())) ? false : 'TIMEZONE_INVALID';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user