mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-28 04:20:32 +02:00
[feature/new-tz-handling] Fix selecting and validating of timezone in UCP
PHPBB3-9558
This commit is contained in:
@@ -1395,6 +1395,22 @@ function validate_language_iso_name($lang_iso)
|
||||
return ($lang_id) ? false : 'WRONG_DATA';
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Timezone Name
|
||||
*
|
||||
* Tests whether a timezone name is valid
|
||||
*
|
||||
* @param string $timezone The timezone string to test
|
||||
*
|
||||
* @return bool|string Either false if validation succeeded or
|
||||
* a string which will be used as the error message
|
||||
* (with the variable name appended)
|
||||
*/
|
||||
function validate_timezone($timezone)
|
||||
{
|
||||
return (in_array($timezone, DateTimeZone::listIdentifiers())) ? false : 'TIMEZONE_INVALID';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the username has been taken, or if it is disallowed.
|
||||
* Also checks if it includes the " character, which we don't allow in usernames.
|
||||
|
Reference in New Issue
Block a user