Default missing values to `''` in OptionHandler::validateOption()
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 7 Jan 2022 08:54:19 +0000 (09:54 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 7 Jan 2022 08:54:19 +0000 (09:54 +0100)
This is required for PHP 8.1 compatibility of i18n options, as these are
handled separately using I18nHandler.

see b46c272b28ba84892534b31c641a6dd412bb0a1e
see 860e98cff580e299cbbd8cdb7eb50d0113b938cc

wcfsetup/install/files/lib/system/option/OptionHandler.class.php

index b167df80986471bfedff8c9a1467fb4baddc6ef6..751fce39b9211b14777f19762dc79470c8b7ea98 100644 (file)
@@ -391,7 +391,7 @@ class OptionHandler implements IOptionHandler
         $typeObj = $this->getTypeObject($option->optionType);
 
         // get new value
-        $newValue = $this->rawValues[$option->optionName] ?? null;
+        $newValue = $this->rawValues[$option->optionName] ?? '';
 
         // get save value
         $this->optionValues[$option->optionName] = $typeObj->getData($option, $newValue);