From 10f6f7aa41890e54546af951ee3375f15ffe67c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 19 Oct 2020 15:09:06 +0200 Subject: [PATCH] Do not ignore errors in invalidateMailForm update script Fixes #3613 --- ...ate_com.woltlab.wcf_5.3_invalidateMailForm.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_invalidateMailForm.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_invalidateMailForm.php index 155a2add65..ecf9ca0ded 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_invalidateMailForm.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.3_invalidateMailForm.php @@ -5,16 +5,18 @@ use wcf\system\WCF; /** * Removes the files belonging to the old MailForm in order to make this completely non-functional. * - * @author Florian Gail + * @author Tim Duesterhus, Florian Gail * @copyright 2001-2020 WoltLab GmbH * @license GNU Lesser General Public License * @package WoltLabSuite\Core */ -@unlink(WCF_DIR . 'lib/form/MailForm.class.php'); -@unlink(WCF_DIR . 'templates/mail.tpl'); +if (file_exists(WCF_DIR . 'lib/form/MailForm.class.php')) { + unlink(WCF_DIR . 'lib/form/MailForm.class.php'); +} -// delete file log entry +// At this point the MailForm.class.php must be absent. Either the unlink() succeeded or +// the file already was gone. $sql = "DELETE FROM wcf".WCF_N."_package_installation_file_log WHERE packageID = ? AND filename = ?"; @@ -23,6 +25,11 @@ $statement->execute([ $this->installation->getPackageID(), 'lib/form/MailForm.class.php' ]); + +if (file_exists(WCF_DIR . 'templates/mail.tpl')) { + unlink(WCF_DIR . 'templates/mail.tpl'); +} + $sql = "DELETE FROM wcf".WCF_N."_template WHERE packageID = ? AND templateName = ?"; -- 2.20.1