From b8ef035697ac5a31874d633dafd2c8b3b059b288 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 17 May 2015 12:28:13 +0200 Subject: [PATCH] Prevent update from failing caused by missing attachment files --- .../files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php b/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php index a891d723ae..c64d355662 100644 --- a/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php +++ b/wcfsetup/install/files/acp/rebuild_attachments_com.woltlab.wcf_2.1.4.php @@ -55,6 +55,11 @@ if ($rebuildData['max']) { else { $attachmentUpdates = array(); foreach ($attachmentList as $attachment) { + if (!file_exists($attachment->getLocation())) { + // missing files should not cause the update to fail + continue; + } + $filesize = filesize($attachment->getLocation()); if ($filesize != $attachment->filesize) { $attachmentUpdates[$attachment->attachmentID] = $filesize; -- 2.20.1