From: Marcel Werk Date: Wed, 3 Apr 2024 11:07:19 +0000 (+0200) Subject: Fix error in user search X-Git-Tag: 6.0.11~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a945e9856d26b971a52f80115990337728c5effa;p=GitHub%2FWoltLab%2FWCF.git Fix error in user search `$value` can be `null`, which leads to subsequent errors. --- diff --git a/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php b/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php index b50d3dcf6f..967f29d361 100644 --- a/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php @@ -60,7 +60,7 @@ class FloatOptionType extends TextOptionType return false; } - $value = StringUtil::trim($value); + $value = StringUtil::trim($value ?: '0'); $value = $this->toFloat($value); $conditions->add("option_value.userOption" . $option->optionID . " LIKE ?", [$value]); diff --git a/wcfsetup/install/files/lib/system/option/TextOptionType.class.php b/wcfsetup/install/files/lib/system/option/TextOptionType.class.php index 6a49c0a029..9bd767bff5 100644 --- a/wcfsetup/install/files/lib/system/option/TextOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/TextOptionType.class.php @@ -77,7 +77,7 @@ class TextOptionType extends AbstractOptionType implements ISearchableConditionU return false; } - $value = StringUtil::trim($value); + $value = StringUtil::trim($value ?: ''); if ($value == '') { $conditions->add("option_value.userOption" . $option->optionID . " = ?", ['']); } else {