From 8275417b1f9c377b9ee10e22379f64ef897af384 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Thu, 5 Apr 2018 14:50:01 +0300 Subject: [PATCH] Fix to respect vendor-specific MIME type https://github.com/webmin/webmin/issues/702 --- extensions/file-manager/extract.cgi | 2 +- extensions/file-manager/file-manager-lib.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/file-manager/extract.cgi b/extensions/file-manager/extract.cgi index 6dd8a6208..a894de53f 100755 --- a/extensions/file-manager/extract.cgi +++ b/extensions/file-manager/extract.cgi @@ -26,7 +26,7 @@ foreach my $name (split(/\0/, $in{'name'})) { &backquote_logged("7z x -aoa " . quotemeta("$cwd/$name") . " -o" . quotemeta($cwd)); } elsif ($archive_type =~ /\/zip/) { &backquote_logged("unzip -o " . quotemeta("$cwd/$name") . " -d " . quotemeta($cwd)); - } elsif ($archive_type =~ /\/x-rar/) { + } elsif ($archive_type =~ /\/x-rar|\/vnd\.rar/) { &backquote_logged("unrar x -r -y -o+ " . quotemeta("$cwd/$name") . " " . quotemeta($cwd)); } elsif ($archive_type =~ "/x-rpm" || $archive_type =~ /\/x-deb/) { my $dir = fileparse("$cwd/$name", qr/\.[^.]*/); diff --git a/extensions/file-manager/file-manager-lib.pm b/extensions/file-manager/file-manager-lib.pm index af5ce106d..91590ad86 100644 --- a/extensions/file-manager/file-manager-lib.pm +++ b/extensions/file-manager/file-manager-lib.pm @@ -369,7 +369,7 @@ sub print_content if (($type =~ /application-zip/ && has_command('unzip')) || ($type =~ /application-x-7z-compressed/ && has_command('7z')) || - ($type =~ /application-x-rar/ && + ($type =~ /application-x-rar|application-vnd\.rar/ && has_command('unrar')) || ($type =~ /application-x-rpm/ && has_command('rpm2cpio') &&