Browse Source

Исправление ошибки в File::delete(). Не работало удаление вариантов старых изображений

master
Alexander Demidov 10 years ago
parent
commit
57f402dd63
  1. 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());
}
}
}

Loading…
Cancel
Save