Skip empty date values in contact form emails
authorAlexander Ebert <ebert@woltlab.com>
Sun, 21 Jan 2018 14:14:46 +0000 (15:14 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 21 Jan 2018 14:14:46 +0000 (15:14 +0100)
wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php

index 5223f853d56bfadca817298b33b813b893f9521c..6d0e0f86e79ba218d34f1d290546ad070a5c9f0c 100644 (file)
@@ -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),