]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 346091: editparams.cgi should validate the 'timezone' parameter - Patch by victor...
authorlpsolit%gmail.com <>
Wed, 15 Nov 2006 04:45:48 +0000 (04:45 +0000)
committerlpsolit%gmail.com <>
Wed, 15 Nov 2006 04:45:48 +0000 (04:45 +0000)
Bugzilla/Config/Common.pm
Bugzilla/Config/Core.pm

index 30b484468a1971291593f70e521f7ee03a105e5a..8b94220f8f29768082581c8d5d3203403d94152f 100644 (file)
@@ -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.
 #
index d359d86aab31832e163868788d10d8ad7b7d08d2..5688e5c8c4a6e5dfa7254656f0da2f3b12892656 100644 (file)
@@ -91,6 +91,7 @@ sub get_param_list {
    name => 'timezone',
    type => 't',
    default => '',
+   checker => \&check_timezone
   },
 
   {