Skip to content

Commit aa0bcd8

Browse files
committed
Remove old image from the file system
1 parent 1ace5d6 commit aa0bcd8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wcfsetup/install/files/lib/system/worker/UnfurlUrlRebuildDataWorker.class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ public function execute()
6767

6868
$deleteStatement->execute([$unfurlUrl->imageID]);
6969
} elseif ($unfurlUrl->fileID !== null) {
70+
$fileLocation = $this->getOldFileLocation($unfurlUrl);
71+
7072
$file = UnfurlUrlEditor::createWebpThumbnail(
71-
$this->getOldFileLocation($unfurlUrl),
73+
$fileLocation,
7274
\pathinfo($unfurlUrl->imageUrl, PATHINFO_FILENAME)
7375
);
7476

77+
@\unlink($fileLocation);
78+
7579
$updateStatement->execute([
7680
$file !== null ? 1 : 0,
7781
$file?->fileID,

0 commit comments

Comments
 (0)