]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1068521: "Use of uninitialized value" warnings
authorPami Ketolainen <pami.ketolainen@jollamobile.com>
Thu, 18 Sep 2014 09:08:07 +0000 (17:08 +0800)
committerByron Jones <glob@mozilla.com>
Thu, 18 Sep 2014 09:08:07 +0000 (17:08 +0800)
r=glob,a=glob

Bugzilla/CGI.pm
process_bug.cgi

index 79e3e053b46abb4a1b869180707cef02c98bd9dc..18181f489cadd394424267c8be014f6737bbadb7 100644 (file)
@@ -373,10 +373,7 @@ sub param {
         if (!scalar(@result)
             && $self->request_method && $self->request_method eq 'POST')
         {
-            # Some servers fail to set the QUERY_STRING parameter, which
-            # causes undef issues
-            $ENV{'QUERY_STRING'} = '' unless exists $ENV{'QUERY_STRING'};
-            @result = $self->SUPER::url_param(@_);
+            @result = $self->url_param(@_);
         }
 
         # Fix UTF-8-ness of input parameters.
@@ -401,6 +398,14 @@ sub param {
     return $self->SUPER::param(@_);
 }
 
+sub url_param {
+    my $self = shift;
+    # Some servers fail to set the QUERY_STRING parameter, which
+    # causes undef issues
+    $ENV{'QUERY_STRING'} //= '';
+    return $self->SUPER::url_param(@_);
+}
+
 sub _fix_utf8 {
     my $input = shift;
     # The is_utf8 is here in case CGI gets smart about utf8 someday.
@@ -732,6 +737,8 @@ L<CGI|CGI>, L<CGI::Cookie|CGI::Cookie>
 
 =item param
 
+=item url_param
+
 =item header
 
 =back
index 4b35bf432b192de612ab0bc94fcb0889e9dfc9f2..b47a3b1cfce4fc888c7d3fe9a0672b3d64289a29 100755 (executable)
@@ -234,7 +234,7 @@ if (should_set('keywords')) {
 }
 if (should_set('comment')) {
     my $is_markdown = ($user->settings->{use_markdown}->{is_enabled} &&
-                            $cgi->param('use_markdown') eq '1') ? 1 : 0;
+                            $cgi->param('use_markdown')) ? 1 : 0;
 
     $set_all_fields{comment} = {
         body        => scalar $cgi->param('comment'),