]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1639903 - Fix `Use of uninitialized value in pattern match (m//) at /app/Bugzilla...
authordklawren <dklawren@users.noreply.github.com>
Mon, 25 May 2020 20:52:20 +0000 (16:52 -0400)
committerGitHub <noreply@github.com>
Mon, 25 May 2020 20:52:20 +0000 (16:52 -0400)
Bugzilla/App.pm

index 1e3e341089c3f06f0c74cca2f06424e140094b95..003e7494c8ec994326cb46365f5c9e80251089fb 100644 (file)
@@ -68,7 +68,8 @@ sub startup {
       # If that is the case, we just log the error and continue on.
       try {
         my $regexp = Bugzilla->params->{block_user_agent};
-        if ($regexp && $c->req->headers->user_agent =~ /$regexp/) {
+        my $user_agent = $c->req->headers->user_agent // '';
+        if ($regexp && $user_agent =~ /$regexp/) {
           my $msg = "Contact " . Bugzilla->params->{maintainer};
           $c->respond_to(
             json => {json => {error => $msg}, status => 400},