fixing unzip/untar/ungzip from panel
This commit is contained in:
parent
5fd5e4837e
commit
f8c5872c99
|
@ -141,7 +141,6 @@ if (!empty($formu) && $formu) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($actextract) && $actextract) {
|
if (isset($actextract) && $actextract) {
|
||||||
print _("extracting...")."<br />\n"; flush();
|
|
||||||
if ($bro->ExtractFile($R. '/' . $fileextract, $R)) {
|
if ($bro->ExtractFile($R. '/' . $fileextract, $R)) {
|
||||||
echo "<p class=\"alert alert-danger\">";
|
echo "<p class=\"alert alert-danger\">";
|
||||||
print $err->errstr();
|
print $err->errstr();
|
||||||
|
|
|
@ -666,25 +666,24 @@ class m_bro {
|
||||||
$err->raise("bro",_("File or folder name is incorrect"));
|
$err->raise("bro",_("File or folder name is incorrect"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
$file=escapeshellarg($file);
|
$lfile=strtolower($file);
|
||||||
$dest_to_fix=$dest;
|
if (substr($lfile,-4)==".tar" || substr($lfile,-8)==".tar.bz2" || substr($lfile,-7)==".tar.gz" || substr($lfile,-6)==".tar.z") {
|
||||||
$dest=escapeshellarg($dest);
|
// TODO new version of tar supports `tar xf ...` so there is no
|
||||||
#$dest_to_fix=str_replace(getuserpath(),'',$dest);
|
// need to specify the compression format
|
||||||
|
echo "<p>"._("Uncompressing through TAR")."</p><pre style=\"overflow: scroll; height: 200px\">";
|
||||||
// TODO new version of tar supports `tar xf ...` so there is no
|
passthru("tar -xf ".escapeshellarg($file)." -C ".escapeshellarg($dest)." 2>&1", $ret);
|
||||||
// need to specify the compression format
|
|
||||||
exec("tar -xf ".escapeshellarg($file)." -C ".escapeshellarg($dest), $void, $ret);
|
|
||||||
if ($ret) {
|
|
||||||
exec("tar -xjf ".escapeshellarg($file)." -C ".escapeshellarg($dest), $void, $ret);
|
|
||||||
}
|
}
|
||||||
if ($ret) {
|
if (substr($lfile,-4)==".zip") {
|
||||||
$cmd="unzip -o ".escapeshellarg($file)." -d ".escapeshellarg($dest);
|
echo "<p>"._("Uncompressing through UNZIP")."</p><pre style=\"overflow: scroll; height: 200px\">";
|
||||||
exec($cmd, $void, $ret);
|
$cmd="unzip -o ".escapeshellarg($file)." -d ".escapeshellarg($dest)." 2>&1";
|
||||||
|
passthru($cmd, $ret);
|
||||||
}
|
}
|
||||||
if ($ret) {
|
if (substr($lfile,-3)==".gz") {
|
||||||
$cmd="gunzip ".escapeshellarg($file);
|
echo "<p>"._("Uncompressing through GUNZIP")."</p><pre style=\"overflow: scroll; height: 200px\">";
|
||||||
exec($cmd, $void, $ret);
|
$cmd="gunzip ".escapeshellarg($file)." 2>&1";
|
||||||
|
passthru($cmd, $ret);
|
||||||
}
|
}
|
||||||
|
echo "</pre>";
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
$err->raise("bro",_("I cannot find a way to extract the file %s, it is an unsupported compressed format"), $file);
|
$err->raise("bro",_("I cannot find a way to extract the file %s, it is an unsupported compressed format"), $file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
alternc (3.1.4) oldstable; urgency=low
|
||||||
|
|
||||||
|
* ensure that values in sub_domaines are prefixed by / for hosting subdomains
|
||||||
|
* adding enable_original_recipient=no to postfix
|
||||||
|
* adding tail log view + order by DATE last files in logs
|
||||||
|
* fix ;;; END ALTERNC zones bug
|
||||||
|
* proposal (not enabled by default) of error.log per vhost
|
||||||
|
* default message size limit to 100M, no mailbox size limit in postfix
|
||||||
|
* fix removal of awstats-package crontab in favor of AlternC's one
|
||||||
|
* fix unzip/untar/ungzip of files from the browser (double escapeshellarg)
|
||||||
|
|
||||||
|
-- Benjamin Sonntag <benjamin@sonntag.fr> Mon, 20 Apr 2015 18:00:12 +0200
|
||||||
|
|
||||||
alternc (3.1.3) oldstable; urgency=low
|
alternc (3.1.3) oldstable; urgency=low
|
||||||
|
|
||||||
* fix opendkim listening on *
|
* fix opendkim listening on *
|
||||||
|
|
Loading…
Reference in New Issue