diff --git a/apps.manifest.inc b/apps.manifest.inc index b5d8df5..cca8521 100755 --- a/apps.manifest.inc +++ b/apps.manifest.inc @@ -251,12 +251,16 @@ function apps_retrieve_app_image($url, $title = FALSE, $alt = FALSE) { $current->title = $title ? $title : ''; $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')); }