Исправление ошибки в File::delete(). Не работало удаление вариантов старых изображений
This commit is contained in:
4
File.php
4
File.php
@ -118,12 +118,12 @@ abstract class File
|
||||
if ($this->getIsNoEmpty()) {
|
||||
@unlink($this->getRealPath());
|
||||
}
|
||||
if (get_parent_class($this) == 'Image') {
|
||||
if (get_parent_class($this) == 'dimti\Image\Image') {
|
||||
$image = $this;
|
||||
foreach ($image->getSizes() as $size) {
|
||||
$image_variant = $image->getVariant($size);
|
||||
if ($image_variant->getIsNoEmpty()) {
|
||||
@unlink($image->getRealPath());
|
||||
@unlink($image_variant->getRealPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user