From 8ac4ec19808ae047675a7d5f9fc6cc3b81cd7400 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 21 Jan 2018 15:14:46 +0100 Subject: [PATCH] Skip empty date values in contact form emails --- .../lib/data/contact/option/ContactOptionAction.class.php | 5 +++++ 1 file changed, 5 insertions(+) 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), -- 2.20.1