Managed_DataObject->updateWithKeys throws its own exception

This commit is contained in:
Mikael Nordfeldth
2015-01-25 12:45:26 +01:00
parent 998afe1844
commit 12058c30b4
10 changed files with 37 additions and 68 deletions

View 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)