forked from Wavyzz/dolibarr
Add protection on upload if file already exists
This commit is contained in:
@@ -65,7 +65,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
{
|
||||
create_exdir($conf->societe->dir_logos);
|
||||
}
|
||||
if (dol_move_uploaded_file($_FILES["logo"]["tmp_name"],$conf->societe->dir_logos.'/'.$original_file))
|
||||
if (dol_move_uploaded_file($_FILES["logo"]["tmp_name"],$conf->societe->dir_logos.'/'.$original_file,1) > 0)
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ if ( $_POST["sendit"] && $conf->upload != 0)
|
||||
{
|
||||
$imp = new DolibarrImport($db);
|
||||
$imp->CreateBackupDir();
|
||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $imp->upload_dir . "/" . $_FILES['userfile']['name']))
|
||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $imp->upload_dir . "/" . $_FILES['userfile']['name'],1) > 0)
|
||||
{
|
||||
|
||||
$imp->ImportClients($imp->upload_dir . "/" . $_FILES['userfile']['name']);
|
||||
|
||||
Reference in New Issue
Block a user