]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Oembed/OembedPlugin.php
Managed_DataObject->updateWithKeys throws its own exception
[quix0rs-gnu-social.git] / plugins / Oembed / OembedPlugin.php
index c5343c7b4f7f7a5a85ef3cc8ea4ce34bd7984167..29c6f08dd28d6338d5a6ea9746142816b3d6f133 100644 (file)
@@ -288,10 +288,8 @@ class OembedPlugin extends Plugin
         $thumbnail->filename = $filename;
         $thumbnail->width = $info[0];    // array indexes documented on php.net:
         $thumbnail->height = $info[1];   // https://php.net/manual/en/function.getimagesize.php
-        if (!$thumbnail->update($orig)) {
-            unlink($fullpath);  // delete the file if database failed to write
-            throw new ServerException(_('Failed to update remotely downloaded file info in database.'));
-        }
+        // Throws exception on failure.
+        $thumbnail->updateWithKeys($orig);
     }
 
     public function onPluginVersion(array &$versions)