summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-11-15 05:45:48 +0100
committerlpsolit%gmail.com <>2006-11-15 05:45:48 +0100
commit8926e604a5ab2baf79418ce7b7135b20ce967bf2 (patch)
tree675174820f1b1dcaf5867f64a40d2f2f8c7a0285 /Bugzilla
parent19588703fd07642a4341f283212a9eef70cbd828 (diff)
downloadbugzilla-8926e604a5ab2baf79418ce7b7135b20ce967bf2.tar.gz
bugzilla-8926e604a5ab2baf79418ce7b7135b20ce967bf2.tar.xz
Bug 346091: editparams.cgi should validate the 'timezone' parameter - Patch by victory(_RSZ_) <bmo2007@rsz.jp> r=LpSolit a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Config/Common.pm10
-rw-r--r--Bugzilla/Config/Core.pm1
2 files changed, 11 insertions, 0 deletions
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.
#
diff --git a/Bugzilla/Config/Core.pm b/Bugzilla/Config/Core.pm
index d359d86aa..5688e5c8c 100644
--- a/Bugzilla/Config/Core.pm
+++ b/Bugzilla/Config/Core.pm
@@ -91,6 +91,7 @@ sub get_param_list {
name => 'timezone',
type => 't',
default => '',
+ checker => \&check_timezone
},
{