]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Insert a `user-contact` for every contact
[friendica.git] / src / Model / Photo.php
index a59c30aca2d854d2e8765bdc82f1aaa1a05ab30c..c09434d7f237a477c80fbb0dc25e63e4643aac8a 100644 (file)
@@ -413,7 +413,7 @@ class Photo
                while ($photo = DBA::fetch($photos)) {
                        try {
                                $backend_class = DI::storageManager()->getWritableStorageByName($photo['backend-class'] ?? '');
-                               $backend_class->delete($item['backend-ref'] ?? '');
+                               $backend_class->delete($photo['backend-ref'] ?? '');
                                // Delete the photos after they had been deleted successfully
                                DBA::delete("photo", ['id' => $photo['id']]);
                        } catch (InvalidClassStorageException $storageException) {
@@ -490,11 +490,12 @@ class Photo
 
                $filename = basename($image_url);
                if (!empty($image_url)) {
-                       $ret = DI::httpRequest()->get($image_url);
+                       $ret = DI::httpClient()->get($image_url);
                        $img_str = $ret->getBody();
                        $type = $ret->getContentType();
                } else {
                        $img_str = '';
+                       $type = '';
                }
 
                if ($quit_on_error && ($img_str == "")) {