From: Alexander Ebert Date: Sun, 21 Jan 2018 14:14:46 +0000 (+0100) Subject: Skip empty date values in contact form emails X-Git-Tag: 3.1.0_RC_2~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ac4ec19808ae047675a7d5f9fc6cc3b81cd7400;p=GitHub%2FWoltLab%2FWCF.git Skip empty date values in contact form emails --- diff --git a/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php b/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php index 5223f853d5..6d0e0f86e7 100644 --- a/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php @@ -56,6 +56,11 @@ class ContactOptionAction extends CustomOptionAction { foreach ($optionHandler->getOptions() as $option) { /** @var ContactOption $object */ $object = $option['object']; + if ($object->optionType === 'date' && !$object->getOptionValue()) { + // skip empty dates + continue; + } + $options[] = [ 'isMessage' => $object->isMessage(), 'title' => $object->getLocalizedName($defaultLanguage),