From 8926e604a5ab2baf79418ce7b7135b20ce967bf2 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 15 Nov 2006 04:45:48 +0000 Subject: Bug 346091: editparams.cgi should validate the 'timezone' parameter - Patch by victory(_RSZ_) r=LpSolit a=justdave --- Bugzilla/Config/Common.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Bugzilla/Config/Common.pm') diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 30b484468..8b94220f8 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -34,6 +34,7 @@ package Bugzilla::Config::Common; use strict; use Socket; +use Time::Zone; use Bugzilla::Util; use Bugzilla::Constants; @@ -47,6 +48,7 @@ use base qw(Exporter); check_opsys check_shadowdb check_urlbase check_webdotbase check_netmask check_user_verify_class check_image_converter check_languages check_mail_delivery_method check_notification + check_timezone ); # Checking functions for the various values @@ -310,6 +312,14 @@ sub check_notification { return ""; } +sub check_timezone { + my $tz = shift; + unless (tz_offset($tz)) { + return "must be empty or a legal timezone name, such as PDT or JST"; + } + return ""; +} + # OK, here are the parameter definitions themselves. # -- cgit v1.2.3-24-g4f1b