diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-06-04 19:06:46 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-06-18 15:07:12 +0200 |
commit | 50936cb2eff3f80d99390c76ef6ac535e73f6cc3 (patch) | |
tree | 7b2aee8eba0a921d19f0bf1fdd319914d0292efa /phpBB/includes/functions_user.php | |
parent | 8f027b68d64c1baa99b272d45f382c17310f1480 (diff) | |
download | forums-50936cb2eff3f80d99390c76ef6ac535e73f6cc3.tar forums-50936cb2eff3f80d99390c76ef6ac535e73f6cc3.tar.gz forums-50936cb2eff3f80d99390c76ef6ac535e73f6cc3.tar.bz2 forums-50936cb2eff3f80d99390c76ef6ac535e73f6cc3.tar.xz forums-50936cb2eff3f80d99390c76ef6ac535e73f6cc3.zip |
[feature/new-tz-handling] Fix selecting and validating of timezone in UCP
PHPBB3-9558
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 9b102b7387..3a77407c20 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1396,6 +1396,22 @@ function validate_language_iso_name($lang_iso) } /** +* 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. * Used for registering, changing names, and posting anonymously with a username |