From 3531e36805143cca625d179fb3a837370e1302d6 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 9 Nov 2016 13:22:04 +0100 Subject: [PATCH] Fixed overwriting of existing mail settings --- .../update_com.woltlab.wcf_3.0_post_sql.php | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_post_sql.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_post_sql.php index 4d3dd5c3cd..8138f7b43d 100644 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_post_sql.php +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_post_sql.php @@ -46,18 +46,15 @@ $sql = "UPDATE wcf".WCF_N."_option SET optionValue = ? WHERE optionName = ?"; $statement = WCF::getDB()->prepareStatement($sql); -$statement->execute([ - WCF::getUser()->username, - 'mail_from_name' -]); -$statement->execute([ - WCF::getUser()->email, - 'mail_from_address' -]); -$statement->execute([ - WCF::getUser()->email, - 'mail_admin_address' -]); +if (!MAIL_FROM_NAME) { + $statement->execute([WCF::getUser()->username, 'mail_from_name']); +} +if (!MAIL_FROM_ADDRESS) { + $statement->execute([WCF::getUser()->email, 'mail_from_address']); +} +if (!MAIL_ADMIN_ADDRESS) { + $statement->execute([WCF::getUser()->email, 'mail_admin_address']); +} // Generate signature_secret try { -- 2.20.1