diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php index 8489a69..b9f3267 100644 --- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php +++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php @@ -255,8 +255,8 @@ public function flush($path = NULL) { // Delete the style directory in each registered wrapper. $wrappers = file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE); foreach ($wrappers as $wrapper => $wrapper_data) { - if (file_exists($wrapper . '://styles/' . $this->id())) { - file_unmanaged_delete_recursive($wrapper . '://styles/' . $this->id()); + if (file_exists($directory = $wrapper . '://styles/' . $this->id())) { + file_unmanaged_delete_recursive($directory); } }