[ticket/17361] Remove temp files

PHPBB-17361
This commit is contained in:
Ruben Calvo 2024-11-28 22:24:28 +01:00
parent a8399c1431
commit 4becf438e1
No known key found for this signature in database

View file

@ -151,10 +151,12 @@ class generate extends \phpbb\console\command\command
$destination = tempnam(sys_get_temp_dir(), 'thumbnail_destination');
file_put_contents($source, $this->storage->read($row['physical_filename']));
@unlink($source);
if (create_thumbnail($source, $destination, $row['mimetype']))
{
$this->storage->write('thumb_' . $row['physical_filename'], fopen($destination, 'rb'));
@unlink($destination);
$thumbnail_created[] = (int) $row['attach_id'];