Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0
This commit is contained in:
commit
75305e095d
@ -22,6 +22,8 @@
|
|||||||
* \brief This script create a xml checksum file
|
* \brief This script create a xml checksum file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
|
||||||
|
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
$script_file = basename(__FILE__);
|
$script_file = basename(__FILE__);
|
||||||
$path=dirname(__FILE__).'/';
|
$path=dirname(__FILE__).'/';
|
||||||
|
|||||||
@ -1136,7 +1136,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
|||||||
if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
|
if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
|
||||||
{
|
{
|
||||||
dol_syslog("Refused to delete file ".$file, LOG_WARNING);
|
dol_syslog("Refused to delete file ".$file, LOG_WARNING);
|
||||||
return False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($nohook))
|
if (empty($nohook))
|
||||||
@ -1185,6 +1185,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
|||||||
{
|
{
|
||||||
$rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
|
$rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
|
||||||
|
|
||||||
|
if (is_object($db)) // $db may not be defined when lib is in a context with define('NOREQUIREDB',1)
|
||||||
|
{
|
||||||
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
|
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||||
$ecmfile=new EcmFiles($db);
|
$ecmfile=new EcmFiles($db);
|
||||||
@ -1199,6 +1201,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else dol_syslog("Failed to remove file ".$filename, LOG_WARNING);
|
else dol_syslog("Failed to remove file ".$filename, LOG_WARNING);
|
||||||
// TODO Failure to remove can be because file was already removed or because of permission
|
// TODO Failure to remove can be because file was already removed or because of permission
|
||||||
// If error because of not exists, we must should return true and we should return false if this is a permission problem
|
// If error because of not exists, we must should return true and we should return false if this is a permission problem
|
||||||
@ -1235,7 +1238,7 @@ function dol_delete_dir($dir,$nophperrors=0)
|
|||||||
if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir))
|
if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir))
|
||||||
{
|
{
|
||||||
dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
|
dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
|
||||||
return False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir_osencoded=dol_osencode($dir);
|
$dir_osencoded=dol_osencode($dir);
|
||||||
@ -1854,7 +1857,7 @@ function dol_uncompress($inputfile,$outputdir)
|
|||||||
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
|
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
$res = $zip->open($inputfile);
|
$res = $zip->open($inputfile);
|
||||||
if ($res === TRUE)
|
if ($res === true)
|
||||||
{
|
{
|
||||||
$zip->extractTo($outputdir.'/');
|
$zip->extractTo($outputdir.'/');
|
||||||
$zip->close();
|
$zip->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user