Fix return values of `ItemListFormField::getSaveValue()`
authorMatthias Schmidt <gravatronics@live.com>
Tue, 1 May 2018 10:27:28 +0000 (12:27 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 1 May 2018 10:27:28 +0000 (12:27 +0200)
See #2509

wcfsetup/install/files/lib/system/form/builder/field/ItemListFormField.class.php

index 883802dd4aa6ae9f8be9d3c572ebed13b12ad06e..973ef1a7136e3cb38ce46093ea3d4b96c8280439 100644 (file)
@@ -57,10 +57,10 @@ class ItemListFormField extends AbstractFormField {
                                return '';
                        
                        case self::SAVE_VALUE_TYPE_CSV:
-                               return implode(',', $this->getValue());
+                               return implode(',', $this->getValue() ?: []);
                        
                        case self::SAVE_VALUE_TYPE_SSV:
-                               return implode(' ', $this->getValue());
+                               return implode(' ', $this->getValue() ?: []);
                        
                        default:
                                throw new \LogicException("Unreachable");