1
0
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:
Joas Schilling
2012-06-04 19:06:46 +02:00
parent 8f027b68d6
commit 50936cb2ef
4 changed files with 33 additions and 12 deletions

View File

@@ -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.