forked from GNUsocial/gnu-social
Fix "Implement a class for automatic temporary file handling"
TemporaryFile::commit throws instead of returning a bool.
This commit is contained in:
parent
001629b6dd
commit
d2c7d70f49
@ -517,7 +517,12 @@ class MediaFile
|
||||
if ($media === 'image') {
|
||||
$result = rename($outpath, $filepath);
|
||||
} else {
|
||||
$result = $tempfile->commit($filepath);
|
||||
try {
|
||||
$tempfile->commit($filepath);
|
||||
$result = true;
|
||||
} catch (TemporaryFileException $e) {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
if (!$result) {
|
||||
// TRANS: Server exception thrown when a file upload operation fails because the file could
|
||||
|
@ -115,7 +115,12 @@ class FFmpegPlugin extends Plugin
|
||||
}
|
||||
|
||||
if ($success) {
|
||||
$success = $tempfile->commit($outpath);
|
||||
try {
|
||||
$tempfile->commit($outpath);
|
||||
} catch (TemporaryFileException $e) {
|
||||
$this->log(LOG_ERR, 'Unable to save the GIF image');
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
|
||||
@unlink($palette);
|
||||
|
Loading…
Reference in New Issue
Block a user