]> git.treefish.org Git - fex.git/blobdiff - bin/logwatch
Original release 20160919
[fex.git] / bin / logwatch
index fdc2f2554993a9db754b1f917b8fd7bf4a754a03..3aafafbc0cf7ab041e3833d0bb2183d3246b0d1f 100755 (executable)
@@ -120,7 +120,11 @@ for (;;) {
     }
     $post = /\nPOST\s/;
     if (/^\n*(CONNECT|CONTINUE).*\s\[([\d_]+)\]/i) { $pid = $2 }
     }
     $post = /\nPOST\s/;
     if (/^\n*(CONNECT|CONTINUE).*\s\[([\d_]+)\]/i) { $pid = $2 }
-    if (/\n(POST|GET)\s+\/(\w+)/i)                 { $cgi = $2 }
+    if (/\n(POST|GET)\s+(\S+)/i) {
+      $cgi = $2;
+      $cgi =~ s:.*/::;
+      $cgi =~ s:\?.*::;
+    }
     if (/Content-Length: (\d+)/i) {
       $d = $1;
       while ($d =~ s/(\d)(\d\d\d\b)/$1,$2/) {};
     if (/Content-Length: (\d+)/i) {
       $d = $1;
       while ($d =~ s/(\d)(\d\d\d\b)/$1,$2/) {};
@@ -180,6 +184,7 @@ sub read_debug_log {
       binmode($log,":utf8");
       while (<$log>) {
         s/\r//;
       binmode($log,":utf8");
       while (<$log>) {
         s/\r//;
+        s/[^\x09\x20-\xFF]/_/g;
         if (/^Content-Disposition:.*name="FILE".*filename="(.+)"/i) {
           print "  FILE=\"$1\"\n";
         } elsif (/^Content-Disposition:.*name="(\w+)"/i) {
         if (/^Content-Disposition:.*name="FILE".*filename="(.+)"/i) {
           print "  FILE=\"$1\"\n";
         } elsif (/^Content-Disposition:.*name="(\w+)"/i) {