[-] BO : Do not delete other default jpg when _deleteOldImages and type defined
This commit is contained in:
@@ -438,10 +438,11 @@ class AdminImagesControllerCore extends AdminController
|
|||||||
if (!is_dir($dir))
|
if (!is_dir($dir))
|
||||||
return false;
|
return false;
|
||||||
$toDel = scandir($dir);
|
$toDel = scandir($dir);
|
||||||
|
|
||||||
foreach ($toDel as $d)
|
foreach ($toDel as $d)
|
||||||
foreach ($type as $imageType)
|
foreach ($type as $imageType)
|
||||||
if (preg_match('/^[0-9]+\-'.($product ? '[0-9]+\-' : '').$imageType['name'].'\.jpg$/', $d) || preg_match('/^([[:lower:]]{2})\-default\-(.*)\.jpg$/', $d))
|
if (preg_match('/^[0-9]+\-'.($product ? '[0-9]+\-' : '').$imageType['name'].'\.jpg$/', $d) || preg_match('/^([[:lower:]]{2})\-default\-'.$imageType['name'].'\.jpg$/', $d))
|
||||||
if (file_exists($dir.$d))
|
if (file_exists($dir.$d))
|
||||||
unlink($dir.$d);
|
unlink($dir.$d);
|
||||||
|
|
||||||
// delete product images using new filesystem.
|
// delete product images using new filesystem.
|
||||||
|
|||||||
Reference in New Issue
Block a user