diff --git a/apps.manifest.inc b/apps.manifest.inc index 5d2d1ec..f144fd5 100755 --- a/apps.manifest.inc +++ b/apps.manifest.inc @@ -265,11 +265,16 @@ function apps_retrieve_app_image($url, $title = FALSE, $alt = FALSE) { $current->alt = $alt ? $alt : $title; return $current; } + else { + // TODO delete managed file object + file_unmanaged_delete($current->uri); + } } $request = drupal_http_request($url, array(), 'GET'); - if (isset($request->data)) { + // TODO check response is actually an image + if (isset($request->data) && $request->code == '200') { // to avoid 404 status where image haven't been found if (!file_exists(drupal_realpath(file_build_uri('apps')))) { drupal_mkdir(file_build_uri('apps')); }