commit
96b7735bbe
@ -554,9 +554,8 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
//var_dump($object->array_languages);exit;
|
//var_dump($object->array_languages);exit;
|
||||||
|
|
||||||
if (GETPOST('deletephoto')) {
|
if (!empty($_FILES['photo']['name'])) {
|
||||||
$object->logo = '';
|
$current_logo = $object->logo;
|
||||||
} elseif (!empty($_FILES['photo']['name'])) {
|
|
||||||
$object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
$object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,6 +785,13 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
if ($file_OK) {
|
if ($file_OK) {
|
||||||
if (image_format_supported($_FILES['photo']['name']) > 0) {
|
if (image_format_supported($_FILES['photo']['name']) > 0) {
|
||||||
|
if ($current_logo != $object->logo) {
|
||||||
|
$fileimg = $dir.'/'.$current_logo;
|
||||||
|
$dirthumbs = $dir.'/thumbs';
|
||||||
|
dol_delete_file($fileimg);
|
||||||
|
dol_delete_dir_recursive($dirthumbs);
|
||||||
|
}
|
||||||
|
|
||||||
dol_mkdir($dir);
|
dol_mkdir($dir);
|
||||||
|
|
||||||
if (@is_dir($dir)) {
|
if (@is_dir($dir)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user